-
Notifications
You must be signed in to change notification settings - Fork 940
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
[5.x] Adding basic authentication by default on signed routes #684
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driesvints
changed the title
Adding basic authentication by default on signed routes
[5.x] Adding basic authentication by default on signed routes
Feb 1, 2024
Could you fix the tests? |
driesvints
reviewed
Feb 1, 2024
According to [RFC-6749](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1) clients can choose from a number of authentication methods to authenticate with the authorization server. Section 2.3.1 states that clients can put the credentials either as a Basic authorization header or passing the credentials in the body of the POST. Right now, the default method for Socialite (in AbstractProvider) is to pass the credentials in the body of the POST. However, the spec states this: > Including the client credentials in the request-body using the two parameters is NOT RECOMMENDED and SHOULD be limited to clients unable > to directly utilize the HTTP Basic authentication scheme (or other > password-based HTTP authentication schemes). So Socialite passes the credentials using the "non recommended" way. Furthermore, this way of passing the credentials in NOT supported by all servers. However, the Basic authentication method is mandated to be compulsory per the spec: > The authorization server MUST support the HTTP Basic > authentication scheme for authenticating clients that were issued a > client password. This commit adds Basic authentication header to the requests created by the `AbstractProvider`.
moufmouf
force-pushed
the
basic_auth_by_default
branch
from
February 1, 2024 15:39
ec8655b
to
8722fad
Compare
Done! |
driesvints
approved these changes
Feb 1, 2024
This was referenced Feb 15, 2024
Closed
Not disputing it being part of the RFC, but this is a breaking change. Did this belong in a minor? |
driesvints
added a commit
that referenced
this pull request
Feb 16, 2024
This reverts commit 05af22c.
driesvints
added a commit
that referenced
this pull request
Feb 16, 2024
@moufmouf I've reverted this again because it seems it's too much of a breaking change for third party providers. We can reconsider for the next major release maybe. @Flightfreak reverted |
No problem 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to RFC-6749 clients can choose from a number of authentication methods to authenticate with the authorization server.
Section 2.3.1 states that clients can put the credentials either as a Basic authorization header or passing the credentials in the body of the POST.
Right now, the default method for Socialite (in AbstractProvider) is to pass the credentials in the body of the POST.
However, the spec states this:
So Socialite passes the credentials using the "non recommended" way.
Furthermore, this way of passing the credentials in NOT supported by all servers. However, the Basic authentication method is mandated to be compulsory per the spec:
As a result, a number of providers need to manually add the Basic authentication as you can see from a simple Github search on the "Providers" Github repository:
https://github.com/search?q=repo%3ASocialiteProviders%2FProviders%20Basic&type=code
It would be better to use by default the only authentication scheme that we know (for sure) is supported by all servers.
This commit adds Basic authentication header to the requests created by the
AbstractProvider
.It does not remove the parameters in the body in order to limit breaking changes.