react-native-auth0: Bug Report: Auth0 SDK Fails on Android Emulator with a0.sdk.internal_error.unknown

Checklist

Description

I am using the Auth0 SDK in a React Native application, and the authentication process works fine on both an iPhone simulator and a physical Android device. However, on the Android emulator, the login attempt fails and enters the catch block with the error: I can also confirm the login was successful from Auth0 dashboard logs.

Something went wrong. CAUSE: Received error with code a0.sdk.internal_error.unknown

Code Snippet:

const auth0 = new Auth0({
    domain: AUTH0_DOMAIN,
    clientId: AUTH0_CLIENT_ID,
});

try {
    const authResponse = await auth0.webAuth.authorize({
        scope: 'openid email profile offline_access',
        prompt: 'login',
        audience: MY_AUDIENCE,
    }, { ephemeralSession: true });

    console.log(authResponse);
} catch (e) {
    console.log(e);
}

Environment Details: React Native Version: 0.70.14 React Version: 18.1.0 OS: macOS 14.7 Android SDK: NDK 22.1.7171670 Xcode: 16.1/16B40 Node Version: 21.6.1 npm Version: 10.2.4 Android Studio Version: 2023.1 AI-231.9392.1.2311.11076708 AVD: API 31 - 12

Reproduction

  1. Initialize the Auth0 instance with the appropriate domain and client ID.
  2. Call the authorize method from webAuth with the specified scopes, prompt, and audience.
  3. Run the app on an Android emulator (tested with the default emulator configuration).
  4. Observe that the login process fails with the error: a0.sdk.internal_error.unknown.

Expected Behavior: The authorize method should succeed and return an authentication response as expected.

Actual Behavior: The process fails on the Android emulator with the error: a0.sdk.internal_error.unknown.

Log:

Something went wrong. CAUSE: Received error with code a0.sdk.internal_error.unknown

Additional context

The issue does not occur on the iPhone simulator or on a physical Android device. The error is consistently reproduced when running on the Android emulator.

Possible Causes / Notes:

  • The issue might be emulator-specific, but it would be useful to investigate if there are any emulator-related settings or configurations that could be causing the Auth0 SDK to fail.
  • The error a0.sdk.internal_error.unknown typically indicates a problem on the SDK side or with the environment (e.g., network issues, API misconfiguration, etc.).

Request for Help:

  • Any guidance on troubleshooting this issue on Android emulators would be appreciated.
  • Is there a specific configuration or setup needed for Auth0 to work correctly on Android emulators?

react-native-auth0 version

3.1.0

React Native version

0.70.14

Expo version

No response

Platform

Android

Platform version(s)

API 31 - 12

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Hello @vjo002, we can see that this issue is not related to SDK and since you already have a ticket with Auth0 to look into this, we will continue the conversation there. Feel free to comment here to reopen this ticket if you still consider the issue is on the SDK side.

@vjo002 Thank you for bringing this issue to our notice. We will take a look at it

Hi @vjo002 👋 @pmathew92 @arpit-jn and @brth31 are maintaining this project now. They will get back to you soon on this 😄