Skip to content
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

Bug Report: Auth0 SDK Fails on Android Emulator with a0.sdk.internal_error.unknown #1001

Open
6 tasks done
vjo002 opened this issue Nov 25, 2024 · 5 comments
Open
6 tasks done
Labels
bug This points to a verified bug in the code

Comments

@vjo002
Copy link

vjo002 commented Nov 25, 2024

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

@vjo002 vjo002 added the bug This points to a verified bug in the code label Nov 25, 2024
@robertevans1
Copy link

I am seeing this same error on my real android device - my android emulator is able to log in as is my iOS device.

@vjo002
Copy link
Author

vjo002 commented Nov 27, 2024

Hi @robertevans1, could you share your config details and if you're using webAuth. Thanks

@vjo002
Copy link
Author

vjo002 commented Dec 4, 2024

@poovamraj++

@poovamraj
Copy link
Contributor

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

@pmathew92
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

4 participants