auth0 / Auth0.Android

Android toolkit for Auth0 API
https://auth0.com
MIT License
208 stars 129 forks source link

NullPointerException in WebAuthProvider #720

Open LouisPennachio opened 4 months ago

LouisPennachio commented 4 months ago

Checklist

Description

I notice the Android Auth0 SDK sometimes throws this exception :

Fatal Exception: java.lang.NullPointerException:
       at com.auth0.android.provider.WebAuthProvider.failure$auth0_release(WebAuthProvider.java:149)
       at com.auth0.android.provider.AuthenticationActivity.deliverAuthenticationFailure$auth0_release(AuthenticationActivity.java:149)
       at com.auth0.android.provider.AuthenticationActivity$launchAuthenticationIntent$1.apply(AuthenticationActivity.java:149)
       at com.auth0.android.provider.AuthenticationActivity$launchAuthenticationIntent$1.apply(AuthenticationActivity.java:149)
       at com.auth0.android.provider.CustomTabsController.lambda$null$0(CustomTabsController.java:149)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6944)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

It originates from here :

WebAuthProvider.login(auth0)
    .withAudience(...)
    .withNonce(...)
    .withParameters(...)
    .withRedirectUri(...)
    .withScope(...)
    .await(context)

Impacted Android devices: Samsung, Oppo, Transsion, Vivo, Huawei Application state: 100% foreground Occurence: 26 times over the last 90 days

Any hint on what could cause this ?

Thanks

Reproduction

Reproduction steps are unknown. I've tried with my own app as well as the Auth0 sample app. The crashes happen only for end-users in production.

Additional context

No response

Auth0.Android version

2.10.2

Android version(s)

9, 10, 11, 12, 13