Crash while login

I can’t add OKTA Auth to Android app.
Have crash while login.

implementation ‘com.okta.android:appauth-android:0.2.4’

My Login class - https://gist.github.com/albka1986/ba693cc77bdd2e39ac65961db688c261

2019-09-17 18:51:18.088 32459-32459/com.--- E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.--- PID: 32459
java.lang.IllegalStateException: Okta Configuration has changed
    at com.okta.appauth.android.OktaAppAuth.login(OktaAppAuth.java:317)
    at com.okta.appauth.android.OktaAppAuth.login(OktaAppAuth.java:299)
    at com.---.ui.okta.OktaAuthActivity$onCreate$2.onClick(OktaAuthActivity.kt:51)
    at android.view.View.performClick(View.java:7333)
    at android.widget.TextView.performClick(TextView.java:14160)
    at android.view.View.performClickInternal(View.java:7299)
    at android.view.View.access$3200(View.java:846)
    at android.view.View$PerformClick.run(View.java:27773)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:6986)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)

Try uninstalling the app to clear the persistent data. The error is caused by a mismatch configuration. That repository isn’t maintained anymore please use the following instead:


Thanks, I switched to the lib:
‘com.okta.android:oidc-androidx:1.0.3’

and now I have a new error:
E/SyncWebAuthClientImpl:No uri registered to handle redirect or multiple applications registered

What does it mean?
I’ve set my config, I took data here:

My current config:

config = OIDCConfig.Builder()
.clientId(“id here”)
.redirectUri(“https://domain.okta.com/login/callback”)
.endSessionRedirectUri(“https://domain.okta.com/login/callback”)
.scopes(“openid”, “profile”, “offline_access”)
.discoveryUri(“https://domain.okta.com”)
.create()

and

android.defaultConfig.manifestPlaceholders = [
“appAuthRedirectScheme”: “com.okta.company
]

I stuck with this, please help.

I experienced this issue today myself. https://github.com/okta/okta-oidc-js/issues/561

I found that you have make sure your redirectUri and endSessionRedirectUri both use the same scheme as your appAuthRedirectScheme. In your example, this would be:

.redirectUri(“com.okta.company:/login/callback”)
.endSessionRedirectUri(“com.okta.company:/login/callback”)

These URIs will also need to be whitelisted in your Okta app.

I have set the URI in Admin Panel just to avoid the empty field.
I don’t use “com.okta.company:/login/callback” anywhere, should I?

Your appAuthRedirectScheme value should match the beginning of your redirect URIs. For example, I have the following in mine:

manifestPlaceholders = [
    appAuthRedirectScheme: 'com.okta.dev-133320'
]

And here’s how I configured my redirect URIs:

.redirectUri(“com.okta.dev-133320:/callback”)
.endSessionRedirectUri(“com.okta.dev-133320:/callback”)

I also have these configured in my native app’s configuration on Okta.

Its not work! when I put the my infos like your @mraible, without http, I have this error:
IllegalArgumentException: It looks like there’s a typo in your Okta domain. Current value: xxxxxx-sky-com.okta.com. You can copy your domain from the Okta Developer Console. Follow these instructions to find it: https://bit.ly/finding-okta-domain

And whe I put with http, I have the same error of the @albka1986 .

Somebody can help us ?

Are you creating a native app or different kind of app? If native, what are the redirect URIs you’re trying to use?