-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add ability to use non-escaped header auth style #476
base: master
Are you sure you want to change the base?
Conversation
This PR (HEAD: 04dcc31) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/oauth2/+/291529 to see it. Tip: You can toggle comments from me using the |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Matt Wielbut: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Andrii Deinega: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Andrii Deinega: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Cody Oss: Patch Set 1: Code-Review-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Andrii Deinega: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Andrii Deinega: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Message from Cody Oss: Patch Set 1: Code-Review-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/291529. |
Is it planned to merge this at one point ? |
They grew tired of saying no, so they said yes and then just no doing it. I am honestly less than impressed (i gave opinion more than a year ago in the source repo) |
Thank you for posting this issue 4 years ago. I encountered this when I was trying to use this library with the go-oauth2/oauth2 library. I agree that this suggested feature will be very helpful and should fix my issue. The relevant section of the RFC for Basic authentication scheme does not mention URL encoding at all. |
Some OAuth providers do not adhere to the standard of accepting query escaped credentials when using Basic header auth. If your client ID or client secret contains non-standard URL query characters they will be rejected by the OAuth provider.
The current implementation always query escapes the
client_id
andclient_secret
:req.SetBasicAuth(url.QueryEscape(clientID), url.QueryEscape(clientSecret))
This PR proposes a new AuthStyle
AuthStyleInHeaderNoEscape
that will pass the credentials unescaped.This has been raised several times:
#251
#318
#320
but without this feature this library cannot be used against some key OAuth providers.
This PR replaces #351 which was raised in an early version of the code.