Created
April 18, 2022 14:18
-
-
Save frankcalise/0729544ed81aafe4c1c31ab50c038e2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const useProxyDefault = !API_CONSTANTS.PRODUCTION | |
const useProxy = Platform.select({ web: false, default: useProxyDefault }) | |
const redirectUri = useProxyDefault | |
? AuthSession.makeRedirectUri({ useProxy }) | |
: `scheme://yourauth0domain.us.auth0.com/${API_CONSTANTS.OS}/${API_CONSTANTS.BUNDLE_ID}/callback` | |
// ... | |
const [request, result, promptAsync] = AuthSession.useAuthRequest( | |
{ | |
redirectUri, | |
clientId: API_CONSTANTS.AUTH0.CLIENT_ID, | |
// id_token will return a JWT token | |
responseType: 'id_token token', | |
// retrieve the user's profile | |
scopes: ['openid', 'profile', 'name', 'email'], | |
extraParams: { | |
// ideally, this will be a random value | |
prompt: 'login', | |
nonce: 'nonce', | |
audience: 'https://yourdomain.com/auth0-test', | |
}, | |
}, | |
{ authorizationEndpoint: API_CONSTANTS.AUTH0.AUTHORIZATION_ENDPOINT } | |
) |
Thanks a ton for your help here - I assume I also need to add the expected final value from line 6 in my allowed callback URLs inside of my auth0 tenant?
Thanks a ton for your help here - I assume I also need to add the expected final value from line 6 in my allowed callback URLs inside of my auth0 tenant?
@matthops Yes that is correct, you'll make two entries one for Android and one for iOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://auth0.com/docs/quickstart/native/react-native/00-login#configure-callback-urls