Not sure if I managed to explain the issue properly as it seems you think that I anticipate to have user credentials at action side.
And of course, thank you for trying to help here!
So, as I said, I am talking about the OAuth server side, not Action side.
Following this guide, after my OAuth server identified the user successfully, it should redirect to callback URL, adding “state” and “code” values to it.
At this stage I receive the green popup message in my custom GPT chat which states that OAuth authentication succeeded.
After that I also receive POST request from chatGPT to TOKEN_URL at my server (remember this one), which I should respond to it with
{
"access_token": "<example access token>",
"token_type": "Bearer",
"expires_in": 60,
"refresh_token": "<example refresh token>"
}
From this moment, all queries which arrive to my server, hold that access_token in the headers.
So, the thing is, that POST request to TOKEN_URL which I mentioned previously - is completely plain. It does not hold any user data. So if there are multiple users, who goes through authentication process at that very moment - I will have no clue which token I am granting to who. Which means- I will not know who sends me the queries.
Another thing is that the guide states that after successful user authentication, the server should POST a JSON object
{ “grant_type”: “authorization_code”,
“client_id”: [client_id],
“client_secret”: [client_secret],
“code”: [the code that was returned with the redirect],
“redirect_uri”: [the same redirect uri as before] }
which is not happening in my case either.
Will appreciate if somebody managed to identify users from queries and will share.