Redirect_uri seems to be wrong

Hi, Please see the application I have setup in " Salesforce OpenId Connect 2" app for authenticating users login from salesforce application.

I have created a Auth Provider in salesforce, and since I have communities enabled the callback URL I have put it in the “Allowed Callback URLs” Auth0 app is
I added Auth0 to my community login page, but whenever I am clicking on the Auth0 I am always getting my redirect_uri as
even if I put http://localhost:3000 it is still the

Can someone please help me find out where from the redirect_uri is picked up.

For your reference,

type or paste code here

Hi @arup.sarkar,

Thanks for reaching out to the Auth0 Community!

I have just taken a look at your Salesforce OpenId Connect 2 Regular Web App and found nothing wrong with the configuration. The Allowed Callback URL is the same one you provided in your post.

Next, when looking closely at your /authorize request, I noticed that the issue is with the redirect_uri that you have used.

Specifically, it is referencing redirect_uri=

In this case, I recommend you change the redirect_uri in your /authorize request to the same Callback URL that you are expecting from your app: redirect_uri=

After making this change, your application will redirect your users to the correct URL.

For more information, please read our Redirect Users After Login documentation.

Please don’ hesitate to let me know if there’s anything else I can do to help.

Thank you.

Thank you @rueben.tiow ,

where do I change the redirect_uri to point to the right one, I thought that the allowed callback URL will be the redirect_uri. Can you please point me to the application settings of the redirect uri.

Thank you

Hi @arup.sarkar,

Thank you for your response.

The redirect_uri is configured in your app’s code. In your initial post, you shared your /authorize request performing an authorization code flow. In this case, you will have to modify the request in your code to look like the following:

You can also test the login by copying and pasting the URL above in a web browser. You will notice that the user gets redirected to the correct redirect_uri after successfully logging in.

Please let me know how this goes for you.


Hi @rueben.tiow, I modified my code as you mentioned. Also created a brand new Customer Web App in Auth0 for this POC.

I actually developed a SPA using

@auth0/auth0-spa-js": “^1.19.4”
Putting in the essential code pieces

const isAuthenticated = await auth0.isAuthenticated()
const options = {
redirect_uri: ‘http://localhost:3000

await auth0.loginWithRedirect(options)

Problem 1: My isAuthenticated is always false, and I believe the reason being I am NOT redirected to the URL I have configured in my app’s Allowed Callback URL which is http://localhost:3000

After the auth0 interface pops up for login, I am always getting the following URL
I have updated the code and state.

Q) Why am I not redirected to http://localhost:3000 ?

Hi @arup.sarkar,

Thank you for your response.

Based on the URL you shared, you redirected to http://localhost:3000 successfully. The code and state parameters are expected as part of the response. You can see an example of it here.

Note that if the redirect_uri in your request does not match one of the Allowed Callback URLs on your application settings, you will get an error.

With that said, the http://localhost:3000/?code=abcd&state=1234abc response URL is correct and to be expected.

The next step is to request the tokens using the code you obtained.

Hoped this helps!


This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.