Skip to content
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

OAuth2 client credentials are sent with wrong Content-Type #47

Closed
Tracked by #284
nverbos-godaddy opened this issue Jan 24, 2024 · 6 comments · Fixed by #51
Closed
Tracked by #284

OAuth2 client credentials are sent with wrong Content-Type #47

nverbos-godaddy opened this issue Jan 24, 2024 · 6 comments · Fixed by #51
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@nverbos-godaddy
Copy link

nverbos-godaddy commented Jan 24, 2024

Description

When an OAuth2 access token is requested from an OAuth2 Authorization server's token endpoint, the credentials are sent using the application/json Content-Type, but client credentials should be sent using the application/x-www-form-urlencoded according to the OAuth 2.0 RFC

Version of SDK

v0.3.1

Reproduction

  1. Configure the openfga client using the OAuth2 Credentials example in the README
  2. Observe that the content-type is set to application/json

Expected behavior

When an OAuth2 token is requested from an OAuth2 Authorization server, the credentials are sent using the application/x-www-form-urlencoded content-type as specified in the OAuth 2.0 RFC

@nverbos-godaddy nverbos-godaddy added the bug Something isn't working label Jan 24, 2024
@rhamzeh
Copy link
Member

rhamzeh commented Jan 24, 2024

Thanks for the report @nverbos-godaddy!

@rhamzeh rhamzeh added the good first issue Good for newcomers label Jan 24, 2024
@rhamzeh
Copy link
Member

rhamzeh commented Jan 24, 2024

@le-yams just looping you in as you had contributed that code. Would changing the content type still work for you?

@le-yams
Copy link
Contributor

le-yams commented Jan 24, 2024

@le-yams just looping you in as you had contributed that code. Would changing the content type still work for you?

Absolutely, @nverbos-godaddy is right 😄

@le-yams
Copy link
Contributor

le-yams commented Jan 24, 2024

@rhamzeh I've created a PR in the sdk-generator project to fix this.

@rhamzeh
Copy link
Member

rhamzeh commented Jan 24, 2024

Thank you!

@rhamzeh
Copy link
Member

rhamzeh commented Jan 26, 2024

Thanks for the report @nverbos-godaddy and for your help @le-yams !

This should be out in the just released v0.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants