Hello Auth0 Community,
I’ve just started building a React Native mobile application with Bare workflow(not using Expo framework).
I have successfully integrated the login and logout system on my app with react-native-auth0 dependency. However, I am struggling with API Authorization to get the token for the authenticated users in order to control the access to each end point.
I am following Authorization Code Flow with PKCE based on the Auth0 documentation. I’ve got almost everything working fine except the redirect uri which was mentioned earlier on the title.
I tried to use the expo-auth-session
dependency to specify the uri manually like below.
const redirectUri = AuthSession.makeRedirectUri({
native: `${REDIRECT_URI}`,
useProxy,
});
const params = {
audience: `${AUTH0_API_AUDIENCE}`,
scope: ['read:user', 'offline_access'],
response_type: 'code',
client_id: `${AUTH0_CLIENT_ID}`,
redirect_uri: redirectUri,
code_challenge: `${code_challenge}`,
code_challenge_method: 'S256',
state: `${state}`
};
However, it returns the error message saying
Error: No default return URL could be found. If you’re using the bare workflow, please provide
options.returnUrl
.
getDefaultReturnUrl@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:179940:24
startAsync$@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false:177411:84
I have checked my uri with npx uri-scheme list
.
at the moment, I’ve got one ${applicationId}://
.
Would this be the equivalent to the redirect_uri, wouldn’t it?
I’ve also have checked Auth0.Android.
However, this one seems to be related to Android Native App development.
Anyway, anyone who has done this? Where I can specify the Redirect URI for Android application built with React Native?