Error in OAuth handling in Custom GPT

Hello,

I’m developing a custom GPT, and every once in awhile (I assume when a token needs to be refreshed) I run into the following error (orange warning box at top of screen). I get this message after hitting the green “Log in” button on the GPT when an action is called.

Missing access token, received 400 from https://[AUTH URL]/oidc/token: response_data={‘code’: ‘oidc.invalid_grant’, ‘message’: ‘Grant request is invalid.’, ‘error_uri’: ‘https://openid.sh/debug/invalid_grant’, ‘error’: ‘invalid_grant’, ‘error_description’: ‘grant request is invalid’}

I would have expected the handing of this to send me to the login screen, but it doesn’t seem to do so. Any thoughts or tips? I cleared my cache, but the oauth seems to be cached at the account level, since I get the same error on the mobile app. Would be great if there was a developer way to clear out OAuth tokens manually. thanks.

Hey there!

So, looking at other posts on the forums, it does seem that you have not been the only one who’s noticed the finicky nature of 0auth token refreshes. It seems people have come up with some solutions here:

1 Like

Thanks for sharing, I did search but couldn’t find anything specific. This guide is useful, but nothing works… I might just blow away the GPT and recreate it, which isn’t very sustainable

Deleting and recreating the GPT didn’t work either… just stuck now :frowning: . I was hoping I could remove the connected accounts, but there’s only a login button, not a button to remove the connected account.

Update… In case it helps anbody - I was able to force a login using a google incognito window after re-logging into OpenAI

Nevermind, now my GPT and my account is totally bricked, no amount of deleting the GPT and recreating seems to work, any OpenAI devs out there taking a look at this? Seem so unreliable that it’s impossible to develop against.

You can manually log out and re-sign in if the issue might be the cached wrong token.
Privacy settings → Connected accounts

Hope this helps.

I’ve tried that, but I’ve so bricked my GPT that I only see the attached… No matter what I do, I can see the actions in the edit feature, but I can’t get it to actually log me in. I can’t even delete and recreate the GPT to fix it, seems to be linked to the OAuth server. I’m at a loss…

Update, I think something timed out and reset… Today I deleted the action and re-added it with the same information and now it works again :man_shrugging: total alchemy…

Moral of the story… until they make it more reliable or give you more control over the OAuth associated with your account behind the scenes, it’s pretty much a down tools waiting game.

In my developing experience on OpenAI OAuth, i feel it’s reliable and have not meet any issue.

In my returned oauth token, i don’t put refresh_token in the response.
Don’t know if it helps, just FYI.

You can check my GPTs.