-
Notifications
You must be signed in to change notification settings - Fork 139
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
authorization_code strategy is not authenticated #128
authorization_code strategy is not authenticated #128
Comments
@robotlovesyou looking at section 4.1.3, I see no mention of |
@robotlovesyou after looking a bit further, I think I see what you're saying in regards to the basic auth header. I was reading in section 2.3 and it appears that the preferred method for sending client credentials is via basic auth header. While this is probably not a complete disaster, I guess I have been misinterpreting the spec all this time. Thank you for bringing it to my attention. I can put together a PR to fix this...although, I'd like to make sure that the change doesn't break existing clients - which I assume it shouldn't. |
Great. Thanks for looking into it. It's not the easiest spec to follow! |
oauth2 has a recent possibly backwards incompatible release that makes sure the spec is followed and authorization headers are respected (https://github.com/scrogson/oauth2/blob/master/CHANGELOG.md#v200-2019-07-15) This fixed ueberauth/oauth2#128 hence I think it's important to include. Decided to not require 2.x as that might conflict too hard with other libraries. Also decided to allow minor version bumps as @scrogson seems to be good about semver <3 As ueberauth#66 isn't merged yet I'd like it if this could get in with the release. fixes ueberauth#67
Unless I am misreading the code, there does not seem to be any attempt to authenticate the client when exchanging the code for a token using the authorization_code strategy. This is similar to the issue #115 but your response there seems wrong by my reading of the spec.
The final paragraph of section 4.1.3, which describes the request for an access token (https://tools.ietf.org/html/rfc6749#section-4.1.3)[https://tools.ietf.org/html/rfc6749#section-4.1.3] reads:
The default behaviour for most libraries seems to be to use basic authentication, although some implementations require or support placing the client_secret in the body. You have these methods in place for the client credentials strategy but for some reason they are not in place for the authorization_code strategy. For an oauth2 implementation which requires the use of basic authorization to authenticate against the authorization server, I guess maybe this can be worked around using the headers property of the client? Where the implementation supports placing the client_secret in the body of the request the issue can be worked around as described in #115 but given the wording of the spec I don't think it's valid to require users of this strategy to implement the authentication themselves.
The text was updated successfully, but these errors were encountered: