New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't exchange authorization code for an OAuth access token #6518
Comments
The general request looks ok. And you're using standard basic auth credentials base64 encoded "client-id:client-password"? |
Yes I do. The issue is that error message |
The Authorization Code is exactly 98 characters. So adding that to the request, the content length without whitespaces is 143 characters.
I see that the content length of your request is 156. Where do these extra characters come from? Are they simply whitespaces? @adriansmares: Since the above Token request is explicitly POST, I see the |
The problem here is that the redirect URI is not provided during the token exchange. The OAuth client which is affected here has multiple redirect URIs, and the first redirect URI in the OAuth client is probably different from the one requested during authorization. Providing the This is mainly from the backend logs of the Identity Server. We don't propagate error causes from |
Summary
I get 400 error when I try to exchange authorization code for an OAuth access token according to the documentation https://www.thethingsindustries.com/docs/reference/api/authentication/
Response body:
Steps to Reproduce
https://eu1.cloud.thethings.network/oauth/authorize?client_id=<oauth_client_id>&redirect_uri=<redirect_uri>&response_type=code
Current Result
Error with code 400 and body:
Expected Result
Response with status code 200 and body
Relevant Logs
No response
URL
https://eu1.cloud.thethings.network/oauth/token
Deployment
The Things Stack Community Edition
The Things Stack Version
No response
Client Name and Version
No response
Other Information
No response
Proposed Fix
No response
Contributing
Code of Conduct
The text was updated successfully, but these errors were encountered: