Hey everyone,
My Custom GPT Action was working perfectly until ~1-2 weeks ago. Now it redirects to https://chatgpt.com/undefined after the callback step. No changes were made to my code or configuration.
Setup
-
Custom GPT with OAuth authentication
-
Microsoft Entra ID (Azure AD) as identity provider
-
Azure Function as my OAuth proxy
The Critical Evidence
When prompting inside the custom GPT, the action gets invoked. the user signs in to the the external URL (azure function) > authorize/callback flow gets initiated. The expected output is authorize/callback connects successfully and redirects back to the custom GPT for querying against the endpoints.
During the authorize/callback flow, ChatGPT redirects to a URL containing the authorization code in the browser:
https://chatgpt.com/aip/g-.../oauth/callback?code=1.ARsAUFzGGuTX...&state=27bc11ed-...
I can take that exact code and successfully call my token endpoint via curl:
bash
curl -X POST https://my-function-app.azurewebsites.net/api/oauth/token \
-d "code=1.ARsAUFzGGuTX..."
Returns valid tokens:
json
{
"token_type": "Bearer",
"scope": "api://client-id/access",
"expires_in": 4352,
"access_token": "eyJ0eXAiOiJKV1Q...",
"id_token": "eyJ0eXAiOiJKV1Q..."
}
This proves my token endpoint works correctly. ChatGPT is either not calling it, or not processing the valid response.
What I’ve Tried
-
Deleting and re-adding OAuth configuration
-
Re-saving the GPT multiple times
-
Adding both
chat.openai.comandchatgpt.comcallback URLs -
Testing in incognito mode and different browsers
-
Testing on separate DEV and PRD environments (same issue)
-
Creating a completely new GPT
Flow Breakdown
-
/oauth/authorize- works -
Microsoft Entra authentication - works
-
/oauth/callback- works, redirects to ChatGPT with code -
ChatGPT should call
/oauth/token- fails here? -
Redirects to
https://chatgpt.com/undefined, away from CustomGPT
Questions
-
Has anyone else experienced this recently?
-
Did OpenAI change something with OAuth handling?
-
Is there a new requirement (like
refresh_token) that wasn’t needed before?
Any help appreciated. I am at my wits-end troubleshooting something that was working with absolutely no changes, flawlessly, just some time ago.