# Redirect URI Mismatch in Auth0 When Authenticating from Custom GPT

**URL:** <https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [September 12, 2024, 4:17pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628 "2024-09-12T16:17:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![TimRiz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timriz/32/60323_2.png) [@TimRiz](https://community.auth0.com/u/TimRiz)\
**Post date:** [September 12, 2024, 4:17pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/1 "2024-09-12T16:17:40Z")

</div>

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

```auto
"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!

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 12, 2024, 7:24pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/3 "2024-09-12T19:24:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TimRiz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timriz/32/60323_2.png) [@TimRiz](https://community.auth0.com/u/TimRiz)\
**Post date:** [September 12, 2024, 8:58pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/4 "2024-09-12T20:58:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 12, 2024, 10:53pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/5 "2024-09-12T22:53:45Z")

</div>

Hi @TimRiz,

Thanks for your update.

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

```auto
  "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

---

<div class="post-metadata">

**Author:** ![TimRiz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timriz/32/60323_2.png) [@TimRiz](https://community.auth0.com/u/TimRiz)\
**Post date:** [September 12, 2024, 11:45pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/6 "2024-09-12T23:45:06Z")

</div>

Hi @rueben.tiow ,

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 ?

Thanks!

---

<div class="post-metadata">

**Author:** ![TimRiz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timriz/32/60323_2.png) [@TimRiz](https://community.auth0.com/u/TimRiz)\
**Post date:** [September 17, 2024, 6:15am UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/7 "2024-09-17T06:15:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 17, 2024, 8:56pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/8 "2024-09-17T20:56:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TimRiz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/timriz/32/60323_2.png) [@TimRiz](https://community.auth0.com/u/TimRiz)\
**Post date:** [September 17, 2024, 10:12pm UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/9 "2024-09-17T22:12:16Z")

</div>

Thanks @rueben.tiow ,

I am truly puzzled as I already have both [https://chatgpt.com](https://chatgpt.com) AND [https://chat.openai.com](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.

---

<div class="post-metadata">

**Author:** ![benstokes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/benstokes/32/59869_2.png) [@benstokes](https://community.auth0.com/u/benstokes)\
**Post date:** [September 18, 2024, 7:18am UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/10 "2024-09-18T07:18:34Z")

</div>

> [@TimRiz](#):
>
> 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.

I also face this problem. But my issue is not resolved[.](https://compassmobile-dollartree.pro/)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 2, 2024, 7:19am UTC](https://community.auth0.com/t/redirect-uri-mismatch-in-auth0-when-authenticating-from-custom-gpt/146628/11 "2024-10-02T07:19:28Z")

</div>

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