Hi there,
I just figured out how to use oAuth to allow custom GPT Actions to access private endpoints.
I used Django as my external service and django-oauth-toolkit as the oAuth service for my external service.
I learned five things so I want to share with everyone here:
-
test your oauth server using postman first
-
you must fill in the scope in the oAuth form in GPT actions regardless so don’t leave it empty unless your oauth can handle
scope=
in your get params -
gpt actions cannot handle PKCE so your oauth server need to turn it off if it’s on by default
-
when you test your gpt with oauth, don’t do it within the preview page, there’s some weird redirection issues. Test it by opening your gpt as if you’re a new user in a fresh browser tab.
-
if you delete or deliberately expire the access token in your oauth backend, then gpt has no way of re-requesting the access token (This is now solved at this thread here).
This is how I fill up the oAuth settings within the custom GPT Action
This is a demonstration of what happens when I deliberately delete or expire the access token on my oAuth server side
I will do a end-to-end, step-by-step, no steps skipped youtube tutorial of what I did to achieve this.
Will update here once it’s done later this week.