[Android] Not getting into success/failure blocks of WebAuth signin

I am using following code to make web sign in, even after successful sign-in, and webview closes, /token call is not made, that means the success/failure blocks that I’ve setup, it is not going into, I am not even seeing the logs
(Auth0 library used : auth0 android 3.5.0, App code in Kotlin)

WebAuthProvider.login(account)
            .withScheme("<MY_SCHEME>")
            .withScope("openid profile email")
            .withAudience("<MY_AUDIENCE_URL>")
            .start(
                this,
                object : Callback<Credentials, AuthenticationException> {
                    override fun onFailure(error: com.auth0.android.authentication.AuthenticationException) {
                        Log.i("MyApp", "Auth0 SignIn failure: ${error.getDescription()} and code: ${error.getCode()}")
                        displayTextView.text = "Error in Auth0 Web Sign In\nError Details: ${error.getDescription()}"
                    }

                    override fun onSuccess(result: Credentials) {
                        Log.i("MyApp", "Auth0 SignIn Success: ${result}")
                        displayTextView.text =
                            "Sign In Successful\nUsername: ${result.user.email}\nAccess Token: ${result.accessToken}\nID Token: ${result.idToken}\nRefresh Token: ${result.refreshToken}\nExpires At: ${result.expiresAt}"
                    }
                },
            )

The overall app setup is exactly similar to example given at github auth0 android kotlin sample: auth0-samples/auth0-android-sample/tree/master/00-Login-Kt
I have configured the same example with my stuff and still seeing the same problem, can anyone help me here? I can provide more details if needed.

FYI, the same setup is working in iOS, without a problem and I do see /token call made, I am getting all the tokens needed.

Hi @h.trivedi,

Welcome to the Auth0 Community!

I understand you are having issues reaching the success/failure blocks you have set up.

Let me look into this and get back to you shortly with an update.

Thanks,
Rueben

Hi @h.trivedi,

I have reviewed your code snippet, and it looks correct syntactically and similar to this example in our Android Sample SDK.

Have you had the chance to try the Sample App itself instead? It might be helpful and provide clues as to why the /token call is not happening.

Thanks,
Rueben

Hello @rueben.tiow,
Thanks for looking it. So just to rule out any possibilities, I actually tried this sample app with my Auth0 and application configurations, but still it had the same behaviour as my own app. Do you need any specific info from such sample app I tried?

Do you think some settings in Auth0 Dashboard (although I did it as per docs so should be correct but still) may causing this problem? (iOS works fine so this has very low probability)

Thanks,
Hardik

Hi @h.trivedi,

Thanks for the reply.

I don’t believe a setting in the Auth0 Dashboard is responsible for the WebAuth not functioning correctly. It might be helpful to verify the behavior by going to your Dashboard Logs to see the requests.

Additionally, I recommend ensuring that your Android/Kotlin version is up-to-date and compatible with the SDK.

If the versions are compatible, it might also be helpful to check the log trace with print statements to see at which point the code failed.

I have attached some helpful resources to help you on your way:

I hope this helps!

Best regards,
Rueben