Redirect URI Mismatch in Auth0 When Authenticating from Custom GPT

Hi all,

I’m experiencing a redirect URI issue when authenticating from my custom GPT. The error I get in Auth0 logs is:

json

Copy code

"description": "The redirect URI is wrong. You sent https://chatgpt.com, and we expected https://chat.openai.com"

I’ve already specified both URIs (https://chatgpt.com and https://chat.openai.com) in my Callback URIs under the app settings, but the problem persists, especially when using the mobile app.

Has anyone encountered this issue or knows if there’s an additional configuration needed specifically for mobile authentication? Any help would be greatly appreciated!

Thanks!

Hi @TimRiz,

Welcome to the Auth0 Community!

I have checked your tenant logs and can confirm that you provided a different redirect URI than the one expected.

Please ensure your redirect_uri matches one of the callback URLs in your app settings. You might need to either add that URL to your app settings or ensure that your app’s redirect_uri points to a valid callback URL.

Secondly, I noticed that this is a regular web application, which does not require any additional configuration to log in on a mobile web browser.

Let me know if you have any further questions.

Thanks,
Rueben

Hi @rueben.tiow ,

Thanks very much for your reply.

The redirect URIs in question get sent by the custom GPT and on that end, there is no difference between the configuration that I personally have an access to.

Are you able to check the logs and see the full URL that Chatgpt sends ? The one that auth0 provides in the logs to me is not complete.

Thanks,
Tim.

Hi @TimRiz,

Thanks for your update.

I have checked your logs and see the same error message you initially shared.

  "description": "The redirect URI is wrong. You sent https://chatgpt.com, and we expected https://chat.openai.com"

Can you view your network activity to see what the redirect_uri provided in the login request was?

Cheers,
Rueben

Hi @rueben.tiow ,

Unfortunately, I have no visibility to the network activity happening on the mobile side of ChatGPT. :frowning:

In any case, it seems that the auth0 log does not show a complete URL (including the path) that was sent as even requests that were successful (from the desktop browser) don’t show all the details in the log.

If you have an access to my configuration, would you be able to give it a quick glance and tell me what’s missing ?

Thanks!

1 Like

Hi @rueben.tiow , just wondering if this is something you are able to help me with ?

1 Like

Hi @TimRiz,

Thanks for the responses.

I have checked your tenant logs and confirmed the same error. The log event type feacft indicates a Failed to exchange authorization code for Access Token. This happens because the redirect_uri in your request to the oauth/token endpoint doesn’t match the allowed callback URLs configured in your app settings.

I was able to reproduce the error by passing an incorrect redirect_uri in the /oauth/token endpoint during the code exchange for an access token.

I recommend checking your app’s code to ensure the correct callback URL is being used for the redirect_uri parameter.

Thanks,
Rueben

Thanks @rueben.tiow ,

I am truly puzzled as I already have both https://chatgpt.com AND https://chat.openai.com specified (together with the full path) on the auth0 side. The values are comma separated and located under “Allowed Callback URLs” inside the app settings.

I also face this problem. But my issue is not resolved.

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