Giter Site home page Giter Site logo

okta-devices-kotlin's People

Contributors

feichen-okta avatar kelvinzhu-okta avatar mingxiajiang-okta avatar releng-internal-okta avatar tommywong-okta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

okta-devices-kotlin's Issues

retrievePendingChallenges method configuration issues

Describe the bug?

I am trying to use AuthenticatorClient#retrievePendingChallenges method in the same way as in the sample app. I invoke it with
private val readScope = listOf("okta.myAccount.appAuthenticator.maintenance.read") and I am receiving following error:

 com.okta.devices.api.errors.DeviceAuthenticatorError$InternalDeviceError: The client is not authorized to use the provided grant type. Configured grant types: [refresh_token, authorization_code].
                                                                                                    	at com.okta.devices.authenticator.exceptions.DeviceResultExtKt.toResult(SourceFile:66)
                                                                                                    	at com.okta.devices.AuthenticatorEnrollmentCore.getToken-0E7RQCE(SourceFile:2)
                                                                                                    	at com.okta.devices.AuthenticatorEnrollmentCore.getToken-0E7RQCE$default(SourceFile:1)
                                                                                                    	at com.okta.devices.push.PushEnrollmentImpl.retrieveMaintenanceToken-gIAlu-s(PushEnrollmentImpl.kt:50)

What is expected to happen?

I expect to retrieve all enrollments with maintance token to check if there are any pending challanges.

What is the actual behavior?

Backend returns following error:
com.okta.devices.api.errors.DeviceAuthenticatorError$InternalDeviceError: The client is not authorized to use the provided grant type. Configured grant types: [refresh_token, authorization_code].

Reproduction Steps?

  1. User login with following scopes:
    "openid",
    "profile",
    "email",
    "offline_access",
    "okta.myAccount.appAuthenticator.manage",
    "okta.myAccount.appAuthenticator.read",
    "okta.myAccount.appAuthenticator.maintenance.read"

  2. User enrolls for Okta Push SDK

  3. On app second startup I call AuthenticatorClient#retrievePendingChallenges method.

Additional Information?

On the server side we have following scopes configured:
image

SDK Version and Artifact(s) used.

OKTA Devices 1.0.0.

Build Information

Not related to building.

Usage of deprecated SafetyNet Attestation API

Describe the bug?

The Play Store is reporting that SafetyNet Attestation API is deprecated and soon will be shut down.
Our app is getting the following warning in the screenshot, because of the dependency com.google.android.gms:play-services-safetynet:18.0.1. Which is a dependency of com.okta.devices:devices-push:1.1.0

Screenshot 2024-03-28 at 11 31 26

What is expected to happen?

To use non-deprecated API

What is the actual behavior?

Usage of a deprecated API

Reproduction Steps?

Using latest version of the library com.okta.devices:devices-push:1.1.0

Additional Information?

No response

SDK Version and Artifact(s) used.

SDK Version 1.1.0

Build Information

No response

test feature

Describe the feature request?

test

New or Affected Resource(s)

test

Provide a documentation link

test

Additional Information?

test

Duplicate class a.a found in modules jetified-devices-core-0.0.1-runtime (com.okta.devices:devices-core:0.0.1)

Describe the bug?

Cannot build a project after adding implementation("com.okta.devices:devices-push:0.0.1") dependency to the project.

It seems that this library uses proguard to obfuscate classes and it creates the same class name as another library used in my project, full error:
Caused by: java.lang.RuntimeException: Duplicate class a.a found in modules jetified-devices-core-0.0.1-runtime (com.okta.devices:devices-core:0.0.1) and jetified-mobilesdk-v1.1.12-runtime (com.liveramp:mobilesdk:v1.1.12)

I found fixes for similar issues in other libraries:

Please use flattenpackagehierarchy in your ProGuard rules to move obfuscated classes in some unique package to prevent aforementioned conflicts with other libraries.

More details:
helpcrunch/android-sdk-demo#33
Adyen/adyen-3ds2-android#14

What is expected to happen?

Project builds after adding this library.

What is the actual behavior?

Project cannot be built.

Reproduction Steps?

Try to build this library with com.liveramp:mobilesdk:v1.1.12 in your dependencies.

Additional Information?

Please check my proposed fix in "Describe bug" section.

SDK Version and Artifact(s) used.

0.0.1

Build Information

gradle:7.2.0

Cannot build app with this SDK without data@scheme attribute in AndroidManifest

Describe the bug?

Cannot build a project after adding implementation("com.okta.devices:devices-push:0.0.2") dependency to the project, with following error:

Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <webAuthenticationRedirectScheme> is provided.

Thanks to the sample app I found out that it can be fixed by adding to app's build.gradle:
manifestPlaceholders["webAuthenticationRedirectScheme"] = "XXX"

But I don't understand why it is needed and there is nothing about it in the integration guide here:
https://developer.okta.com/docs/guides/authenticators-custom-authenticator/android/main/#install-and-configure-the-okta-devices-sdk

In my use case I just want to use the PUSH Notifications as a second factor of auth and I already have OKTA integrated with this library https://github.com/openid/AppAuth-Android for authorisation.

What is expected to happen?

Project builds after adding this library with no extra dependencies.

What is the actual behavior?

Project cannot be built.

Reproduction Steps?

Add implementation("com.okta.devices:devices-push:0.0.2") dependency to the project

Additional Information?

No response

SDK Version and Artifact(s) used.

0.0.2

Build Information

gradle:7.2.0

User can still see Push notification enrollment method on the web, after deleting enrollment with SDK

Describe the bug?

User can still see Push notification enrollment method on the web, after deleting enrollment with SDK 1.0.0.

What is expected to happen?

User no longer sees "Get push notification" as one of the verify options, when logging in via website, after deleting enrollment.

What is the actual behavior?

User can see "Get push notification" as one of the verify options, after deleting enrollment.
image

Reproduction Steps?

  1. Log in with Okta to retrieve accessToken.
  2. Enroll for Okta Push SDK with com.okta.devices.push.api.PushAuthenticator.enroll(accessToken,config,params)
  3. User can see "Get push notification" as one of the verify options.
  4. Delete enrollement using com.okta.devices.push.api.PushAuthenticator.delete(accessToken,config,params) - with the same access token.

Additional Information?

No response

SDK Version and Artifact(s) used.

OKTA Devices 1.0.0.

Build Information

Not related to building.

test bug report

Describe the bug?

test bug

What is expected to happen?

test

What is the actual behavior?

test

Reproduction Steps?

test

Additional Information?

test

SDK Version and Artifact(s) used.

test

Build Information

test

Crash on Sample App startup, after adding local.properties and google-services.json

Describe the bug?

I was experimenting with different values in local.properties and after several install/uninstall actions it got stuck with following crash.

I tried to uninstall the app and clear app data, clear cache, but it is still crashing on the fresh install. Stack trace:
FATAL EXCEPTION: main
Process: example.okta.android.push_sample_app, PID: 11809
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:581)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)ย 
Caused by: com.google.crypto.tink.shaded.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
at com.google.crypto.tink.shaded.protobuf.ArrayDecoders.decodeUnknownField(ArrayDecoders.java:1036)
at com.google.crypto.tink.shaded.protobuf.ArrayDecoders.decodeUnknownField(ArrayDecoders.java:1028)
at com.google.crypto.tink.shaded.protobuf.MessageSchema.parseProto3Message(MessageSchema.java:5426)
at com.google.crypto.tink.shaded.protobuf.MessageSchema.mergeFrom(MessageSchema.java:5442)
at com.google.crypto.tink.shaded.protobuf.ArrayDecoders.decodeMessageField(ArrayDecoders.java:246)
at com.google.crypto.tink.shaded.protobuf.ArrayDecoders.decodeMessageList(ArrayDecoders.java:704)
at com.google.crypto.tink.shaded.protobuf.MessageSchema.parseProto3Message(MessageSchema.java:5373)
at com.google.crypto.tink.shaded.protobuf.MessageSchema.mergeFrom(MessageSchema.java:5442)
at com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite.parsePartialFrom(GeneratedMessageLite.java:1567)
at com.google.crypto.tink.shaded.protobuf.GeneratedMessageLite.parseFrom(GeneratedMessageLite.java:1680)
at com.google.crypto.tink.proto.Keyset.parseFrom(Keyset.java:958)
at com.google.crypto.tink.integration.android.SharedPrefKeysetReader.read(SharedPrefKeysetReader.java:84)
at com.google.crypto.tink.CleartextKeysetHandle.read(CleartextKeysetHandle.java:61)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.read(AndroidKeysetManager.java:332)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.readOrGenerateNewKeyset(AndroidKeysetManager.java:288)
at com.google.crypto.tink.integration.android.AndroidKeysetManager$Builder.build(AndroidKeysetManager.java:239)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:169)
at androidx.security.crypto.EncryptedSharedPreferences.create(EncryptedSharedPreferences.java:130)
at example.okta.android.sample.client.AuthenticatorClient.(AuthenticatorClient.kt:64)
at example.okta.android.sample.MyBankApplication$authenticatorClient$2.invoke(MyBankApplication.kt:24)
at example.okta.android.sample.MyBankApplication$authenticatorClient$2.invoke(MyBankApplication.kt:24)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at example.okta.android.sample.MyBankApplication.getAuthenticatorClient(MyBankApplication.kt:24)
at example.okta.android.sample.app.MainActivity$onCreate$1$1.invoke(MainActivity.kt:31)
at example.okta.android.sample.app.MainActivity$onCreate$1$1.invoke(MainActivity.kt:30)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.material.MaterialTheme_androidKt.PlatformMaterialTheme(MaterialTheme.android.kt:23)
at androidx.compose.material.MaterialThemeKt$MaterialTheme$1$1.invoke(MaterialTheme.kt:82)
at androidx.compose.material.MaterialThemeKt$MaterialTheme$1$1.invoke(MaterialTheme.kt:81)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.material.TextKt.ProvideTextStyle(Text.kt:363)
at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:81)
2023-04-19 13:03:04.338 11809-11809 AndroidRuntime exa....okta.android.push_sample_app E at androidx.compose.material.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:80)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.material.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:72)
at example.okta.android.sample.app.MainActivity$onCreate$1.invoke(MainActivity.kt:30)
at example.okta.android.sample.app.MainActivity$onCreate$1.invoke(MainActivity.kt:29)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252)
at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:177)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:123)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:122)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:114)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:157)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$3.invoke(Wrapper.android.kt:156)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:156)
at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:140)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:78)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3352)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3342)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3342)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3277)
at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:587)
at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:966)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
2023-04-19 13:03:04.339 11809-11809 AndroidRuntime exa....okta.android.push_sample_app E at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:140)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1072)
at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:131)
at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:182)
at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314)
at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:138)
at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:131)
at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1159)
at android.view.View.dispatchAttachedToWindow(View.java:21976)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4293)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:4302)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3474)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2924)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10513)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1108)
at android.view.Choreographer.doCallbacks(Choreographer.java:866)
at android.view.Choreographer.doFrame(Choreographer.java:797)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1092)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
... 3 more

What is expected to happen?

Application starts without a crash.

What is the actual behavior?

Sample app crashes on startup.

Reproduction Steps?

  1. Fill in local.properties.
  2. Add you google-service.json
  3. Install and unistall app several times.

Additional Information?

n/a

SDK Version and Artifact(s) used.

Okta Push SDK 1.0.0

Build Information

n/a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.