I have 2 apps we are trying to get set up to use Auth0 and believe I have set up everything correctly in both. However, only one works, even though the configurations for both appear to be the exact same. Here is the error page I am redirected to in the second app (which does not work):
In the first, we are successfully able to redirect users to the Universal Login page, have them authenticate, and then be redirected to the redirect_uri
we specify in our Auth0Provider
options. However, in the second, we are redirected to the above error page.
Here are the configurations we are using in both apps:
REACT_APP_AUTH0_ISSUER_URL=<issuer-url>
REACT_APP_AUTH0_CLIENT_ID=<client-id>
REACT_APP_AUTH0_AUDIENCE=<api-url>
REACT_APP_AUTH0_REDIRECT_URI="http://localhost:3003/user/callback"
REACT_APP_AUTH0_SCOPES=<scopes>
We are then using these environment variables and assigning them to our Auth0Provider
like this:
const auth0config = {
domain: REACT_APP_AUTH0_ISSUER_URL,
clientId: REACT_APP_AUTH0_CLIENT_ID,
audience: REACT_APP_AUTH0_AUDIENCE,
redirectUri: REACT_APP_AUTH0_REDIRECT_URI,
scope: REACT_APP_AUTH0_SCOPES,
};
function Auth0Wrapper({ children }) {
return <Auth0Provider {...auth0config}>{children}</Auth0Provider>;
}
In the second failing app, I have verified the the redirect_uri
is valid and is set as an Allowed Callback URL and it exactly matches what we’re using in the above configuration, however I’m still getting sent to that error page.
Any help on this would be greatly appreciated, and if there is any other context I could provide that would be helpful I would be happy to elaborate.
I am running this on:
- MacOS Ventura 13.0
- Chrome 110.0.5481.77 (Official Build) (x86_64)
- Node v12.18.1
-
auth0/auth0-react
^2.0.0
EDIT:
I have taken a look at these issues already to see if I was making the same mistake but they appear to be unrelated: