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!
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.
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.
Unfortunately, I have no visibility to the network activity happening on the mobile side of ChatGPT.
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 ?
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.
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.