-
Notifications
You must be signed in to change notification settings - Fork 448
[Android] additionalExchangeParameters cannot be null #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We’re seeing the same thing with v5.1.3. |
Still seeing this error on v6.0.0
createTokenExchangeRequest with additionalParams which should not be null. (see here: https://github.com/Azure-Samples/active-directory-b2c-android-native-appauth/blob/3fee05d1ed6301dd5a9be90f2900c6266c969402/library/java/net/openid/appauth/AuthorizationResponse.java#L458)I can't figure out why this is happening. Would a workaround be to patch react-native-app-auth to call response. createTokenExchangeRequest() instead when this.additionalParametersMap is null?
|
Hi! Thanks for your suggestion @lordkiz, it seems to work fine. This is my patch file which also contains a fix for the The main thing is to check for null on skipCodeExchange, usePKCE and additionalParametersMap. I have also wrapped the whole onActivityResult in a try/catch with a custom AppAuthErrorCode, but this is not necessary.
|
@yberstad Do you happen to have a patch that patches 7.1.0 cleanly? Edit: Forget it, the above patch works on 7.1.0 as well. It was just an error on my side (tried to apply this patch when it was already patched with the slightly different patch from Nirodha26#1) |
@carbonrobot if this was fixed in v7.1.1 does it mean that it is included in the code moving forward? asking because I was using the latest version and I encountered this error. |
@mmalaguti That's correct. If your still having a problem, please file a new issue with reproduction so we can track it. |
Issue
Once I upgraded to the 5.1.2 version of the library, I started getting this crash on Android which wasn't the case before.
Firebase Crashlytics is showing that some android users are getting this crash and I am unable to replicate it.
Fatal Exception: java.lang.RuntimeException
Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=com.saicomembers.portal:/callback?code=42c3e7fd5e18f675781670544e6cb7785d0e9e51ccac355a32f2d724476dc64f&scope=openid profile MobileApi offline_access&state=iiVkPbyNcTUftf_WkEWNgQ&session_state=aPQ4ArXSgr71BLZMM4YX_vX38tiI1qgRvlJ55Xe5pkM.b3709100ebfbecb216cd454f2d33b64f (has extras) }} to activity {com.saicohealth.members/com.saicohealth.members.MainActivity}: java.lang.NullPointerException: additionalExchangeParameters cannot be null
Below is the full stack trace:
net.openid.appauth.Preconditions.checkNotNull (Preconditions.java:55)
net.openid.appauth.AuthorizationResponse.createTokenExchangeRequest (AuthorizationResponse.java:454)
com.rnappauth.RNAppAuthModule.onActivityResult (RNAppAuthModule.java:401)
com.facebook.react.bridge.ReactContext.onActivityResult (ReactContext.java:262)
com.facebook.react.ReactInstanceManager.onActivityResult (ReactInstanceManager.java:703)
com.facebook.react.ReactActivityDelegate.onActivityResult (ReactActivityDelegate.java:124)
com.facebook.react.ReactActivity.onActivityResult (ReactActivity.java:75)
android.app.Activity.dispatchActivityResult (Activity.java:8393)
android.app.ActivityThread.deliverResults (ActivityThread.java:5442)
android.app.ActivityThread.handleSendResult (ActivityThread.java:5490)
android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:51)
android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:149)
android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:103)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:2373)
android.os.Handler.dispatchMessage (Handler.java:107)
android.os.Looper.loop (Looper.java:213)
android.app.ActivityThread.main (ActivityThread.java:8147)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1101)
These are my authentication settings:
const commonConfig = {
clientId: 'NativeApp',
redirectUrl: 'com.saicomembers.portal:/callback',
scopes: ['openid', 'profile', 'MobileApi', 'offline_access'],
serviceConfiguration: {
authorizationEndpoint: API.BASE_URL_IDENTITY + 'connect/authorize?prompt=login&domain=' + API.ORIGIN,
tokenEndpoint: API.BASE_URL_IDENTITY + 'connect/token?domain=' + API.ORIGIN,
}
};
const authenticationConfig = isAndroid() ? {...commonConfig, additionalParameters: {prompt: "login"}} : {...commonConfig, additionalParameters: {prompt: "login", domain: API.ORIGIN}};
Environment
The text was updated successfully, but these errors were encountered: