Plugin Oauth error: "Error getting system message: {"message": "User is missing credentials"}"

We are sending the refresh token, that part works.

Any way we can get an OpenAI member to comment?

1 Like

Mine appears to be working now. I have not had the problem since yesterday and my original token has expired and was refreshed. My last token request was through Postman, though, not on install. I don’t know if that makes a difference. Also, I’ve made a dozen changes since I started troubleshooting it, so I’m not sure what worked. But I can share what I’ve done if it’s still not working for anyone.

Having the same issue when using auth0. Im using a proxy endpoint so I can specify audience, is there something I can add there to make to make it work?

this is what im doing currently

https://community.openai.com/t/need-to-have-the-ability-to-add-an-audience-for-oauth-in-plugins/182418

How do you get your client id and redirect uri?

Please can you assist us, as I do not know how to get these.

1 Like

I have the same issue as OP using Microsoft Identity Platform (MIP) and an unverified plugin. MIP is definitely returning a refresh token. I feel like Open AI should detect the 401 response and direct the user to the authorization page to sign in again if the refresh token isn’t working for some reason.

1 Like

If you’re using a product like Auth0, or something like Google Oauth (any social oauth actually), you’ll find them in the configuration for your application. You have to set up an app as your target for authorization. And in that app, in the case of Auth0 it’s going to be on your dashboard under the app you configured to authenticate with, you’ll find that information. What are you using to authenticate?

I’m also running into an issue where my plugin stops working after about 24 hours or so. I think I did not set up Google’s Auth correctly and I need to make /auth and /token endpoints on my backend rather than calling Google directly.

Ah I realized the issue I think. ChatGPT does not include access_type=offline, so Google does not return a refresh token. Trying to think of what to do to work around that.

Update: I worked around it by implementing an /auth and /token endpoint, and in my auth endpoint I added access_type: "offline" to the search params.

You can see the implementation here: smart-playlist-generator/auth.js at main · AustinMichaelColeman/smart-playlist-generator · GitHub

I’m using Vercel serverless functions to deploy it. It’s a Smart Playlist Generator plugin for ChatGPT and for YouTube Music. Not yet publicly available but I feel pretty close.

It’s possible I still didn’t implement auth correctly, if anyone knows better or needs help feel free to reach out.

Update:

I realized that in order for a refresh token to be returned from the endpoint, you have to revoke the permissions for your app if you previously had authorized it without passing “access_type”:“offline” in the parameters: https://myaccount.google.com/permissions

So actually maybe my /auth and /token endpoints are working, I just needed to revoke the permissions on my end so that Google sends a new refresh token. I just tested it and now Google does return a refresh token.

One more thing I forgot to do that I just fixed: my /token ends point needed to handle both grant_type === “authorization_code” and grant_type === “refresh_token”:

I think it’s working now

3 Likes