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

Content-Type in token reauests #160

Open
1 task
marekvospel opened this issue Mar 3, 2023 · 0 comments
Open
1 task

Content-Type in token reauests #160

marekvospel opened this issue Mar 3, 2023 · 0 comments
Labels
feature Unimplemented addition

Comments

@marekvospel
Copy link

Feature

I've been trying this library out yesterday, but after setting up something simillar to the examples, I started making requests, but evey single one was invalid, because i used application/json content type instead of application/x-www-form-urlencoded (Reading the source code I noticed it isn't even checked (At least in case of rocket frontend) and is automatically decoded with serde_urlform.

Yes, the OAuth2 specification doesn't mention JSON content type in the requests, but it has become common to also allow JSON, (Before reading some parts of the specs, I didn't even know JSON isn't the default for OAuth2.) so I belive it should be supported, or at least an option to use custom Content-Type could be added.

Alternatives

Because this is an extra feature on top of the OAuth2 spec, I think it would need to be an additional feature.
Alternatively (at least in the case of rocket frontend) the Data inside OAuthRequest could be an enum of different grant types (and their data inside), and an additional method could be added, to let users parse the body on their own.

Context

https://github.com/HeroicKatora/oxide-auth/blob/master/oxide-auth-rocket/src/lib.rs#L97

Tracking pull request

  • does not exist
@marekvospel marekvospel added the feature Unimplemented addition label Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Unimplemented addition
Projects
None yet
Development

No branches or pull requests

1 participant