auth0 / react-native-auth0

React Native toolkit for Auth0 API
https://auth0.com
MIT License
478 stars 206 forks source link

on the Android side, How to open the login page normally when the application package name contains uppercase letters #877

Open cx5168 opened 6 months ago

cx5168 commented 6 months ago

Checklist

Description

The application package name contains uppercase letters, and callbackUrl has been set to lowercase letters. Setting customScheme cannot open it properly.

I hope to not change the application package name and be able to use auth0 normally.

Please provide some solutions, thank you.

Reproduction

  1. In the auth0 console, callbackUrl has been set to lowercase letters (e.x. com.testapp.auth0://auth0.com/android/com.testapp/callback)
  2. The package name in the application contains uppercase letters (e.x. com.testApp)
  3. Accessing webAuth.authorize, customScheme has been set (e.x. customScheme: com.testApp.auth0)
  4. The app/build.gradle has added the manifestPlaceholders setting (e.x. manifestPlaceholders=[auth0Domain: "auth0.com", auth0Scheme: "${applicationId}.auth0"]). The applicationId is com.testApp.
  5. Android: launchMode="singleTask" has been removed from AndroidManifest.xml

Additional context

No response

react-native-auth0 version

3.1.0

React Native version

0.73.4

Expo version

No response

Platform

Android

Platform version(s)

34

cx5168 commented 6 months ago

Solved it. Please refer to No.1:https://github.com/auth0/react-native-auth0/blob/master/FAQ.md

cx5168 commented 6 months ago

But there is another issue. After the first successful login, the same email will be logged in again and the login page will be automatically skipped.

Please help

cx5168 commented 6 months ago

But there is another issue. After the first successful login, the same email will be logged in again and the login page will be automatically skipped.

Please help

kulaszewicz commented 5 months ago

@cx5168 Have you solved the issue, and could you provide the details how you solved in in the first comment? I read the first point but it still doesn't work for me.

cx5168 commented 5 months ago

@kulaszewicz

  1. On the management side of auth0, set the value of callbackURL to lowercase letters
  2. Delete the manifestPlaceholders setting for app/build.gradle
  3. In AndroidManifest.xml, add the following line `<activity android:name="com.auth0.android.provider.RedirectActivity" android:exported="true" tools:node="replace">

    `

  4. delete the build folder for app
  5. rebuild
GriffinMeyer commented 4 weeks ago

I found that version 3.2.1 simply does not work with Expo and custom scheme. After updating to the v4 beta, everything works as expected!

Hope this helps someone not waste the hours I did not just trying the latest version....