-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] Add new bearer option #30547
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
Conversation
I thought about it, but do we really need it, when the alternative is that one? Yes, it's shorter, but adding the option means added burden when implementing the interface. |
Using a Bearer token is very common when requesting an API (more common than Basic). Also, it can be error prone (for instance, your example is wrong because the |
Regarding the burden, as this trait isn't internal, it should not be a big deal. |
6c793d5
to
190258f
Compare
f262b78
to
f79ef21
Compare
Thank you @dunglas. |
This PR was squashed before being merged into the 4.3-dev branch (closes #30547). Discussion ---------- [HttpClient] Add new bearer option | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes<!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | n/a Add a new "auth_bearer" option to set the corresponding flavor of the `Authorization` header as defined in RFC 6750 and used in OAuth (and others). Also rename "auth" to "auth_basic" for consistency as discussed with @nicolas-grekas. Commits ------- f79ef21 [HttpClient] Add new bearer option
Add a new "auth_bearer" option to set the corresponding flavor of the
Authorization
header as defined in RFC 6750 and used in OAuth (and others).Also rename "auth" to "auth_basic" for consistency as discussed with @nicolas-grekas.