Hello,
I created Oauth2 integrations on your website, and now I do the authentication request and then the token creation request, like described on your doc.
The problem is that I can get the access token, but it doesn't work every time, it seems that I get to randomly. However I always do the same way. I also tried with Insomnia and Postman, and when it does not work, I get the response :
'Response': '{"error":"invalid_grant","error_description":"Unrecognized grant code"}'
I verified, the code_verifier is the same in the two request (/authorize and /token), so the code_challenge is the same as in the response.
Here is my request to /authorize : $"https://airtable.com/oauth2/v1/authorize?response_type=code&client_id={OAuth2Infos.ClientId}&code_challenge={codeChallenge}&code_challenge_method=S256&scope={OAuth2Infos.Scope}&redirect_uri={OAuth2Infos.RedirectUrl}"
And for the /token request, I send :
authorization_code:<received_authorization_code>, redirect_uri={OAuth2Infos.RedirectUrl}, grant_type="authorization_code", code_verifier=<our_code_verifier>,
and in the header request I add my clientID and my clientSecret as basic authentication, the request is sent as x-www-form-urlencoded.
I cannot determine why it works or not, but I precise that the /authorize request works fine.
Here is a response retrieved from Insomnia :
OAuth 2.0 Error invalid_request Must include both "code_challenge" and undefined