Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Security] OAuth2 Introspection Endpoint (RFC7662)#50027
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
wouterj commentedApr 16, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for yet another security feature proposal! I want to discuss a general remark that I don't think I've shared publicly yet.(disclaimer: I know literally nothing about OAuth 2.0 and OIDC, except that it consists of a ton of different standards, so I can't determine if this applies to this PR) My vision for Symfony Security is to provide a minimal implementation following industry best practices based on standards and let community libraries/bundle add all "bonus features". We don't have the man power nor knowledge to maintain let's say all OAuth, SAML, Webauthn and MFA standards. When adding new features, I think we must always test it to those 3 conditions:
cc@chalasr |
chalasr commentedApr 16, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I agree with Wouter. |
Many thanks for your feedback and advices. Hereafter my thoughts on this
No problem. I based it on the branch 6.3, but it does not matter to rebase to another branch.
Even if the community is large enough, I understand there is a risk to include specific authentication means that could be a problem in the future.
I was not aware of those, but seem to be fair enough.
Noted. Thanks. In this case, there is no need to go further here. I will continue that work in a side project. 👍 |
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_access_token.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OAuth2TokenHandlerFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Spomky commentedMay 15, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi, I revised my mind and I would like to reopen this PR. I think this should be challenged a bit more. sequenceDiagram participant Client participant Authorization Server participant Resource Server Authorization Server->>Client: IDToken+Access Token (after consent+authentication) loop PR 48272 acts here Client->>Client: IDToken Client->>Authorization Server: Access Token (UserInfo Endpoint) end Client->>Resource Server: Access Token loop This PR acts here Resource Server->>Resource Server: Access Token (e.g. JWT, PASETO...) Resource Server->>Authorization Server: Access Token (Introspection Endpoint) end As you can see, the features introduced with#48272 allow a Client application to authenticate end-users (by end-user, the OAuth spec means a person). The Client app can either use the IDToken (JWT) or the Access Token+UserInfo Endpoint to retreive the end-user details. sequenceDiagram participant Client participant Authorization Server loop PR 48272 acts here Client->>Client: IDToken Client->>Authorization Server: Access Token (UserInfo Endpoint) end This PR acts in a very similar way. The main differences are as follows:
sequenceDiagram participant Resource Server participant Authorization Server loop This PR acts here Resource Server->>Resource Server: Access Token (e.g. JWT, PASETO...) Resource Server->>Authorization Server: Access Token (Introspection Endpoint) end The reason why I think this PR deserves more attention is that is cover the missing piece for covering most of the OAuth2 use cases. I understand the point of view you say we could rely community on community works. And that's true that several solutions exist. But here, no third party library with exotic dependencies is needed1. We can directly use it with few configuration lines on e.g. ApiPlatform-based resource servers. Also, I understand that Symfony does not aim at implementing all industry/web standards (even if all the Notifier channels make me think the opposite). However, OAuth2 is so widely used by the industry that it would be a shame not to support it, in particular after the works on the previous PRs. It is not a trendy technology, but a standard widely used for more than 10 years (and in continuous evolution). At last but not least, the item Support for third-party authentication services (e.g. Auth0:https://auth0.com/) in[RFC] Symfony Security rework tracking issue proposed by@curry684 could be marked as checked as this feature will allow communication withauth0/Okta,OneLogin and many more. 1: this does not mean community works are useless. They all have great features, but having too much external dependencies is something we all try to avoid. |
...Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OAuth2TokenHandlerFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
013329c
to9fdb2ed
Compare
chalasr left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I changed my mind, given we have OAuth/OIDC support let's do it right + as complete as possible. 👍 once the small comments addressed & PR rebased
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Exception/MissingClaimException.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
That's good news! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Here are some CS suggestions, please rebase also.
...Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OAuth2TokenHandlerFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/SecurityBundle/Resources/config/security_authenticator_access_token.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OAuth2TokenHandlerFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OAuth2TokenHandlerFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/OAuth2/Oauth2TokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Security/Http/Tests/AccessToken/OAuth2/OAuth2TokenHandlerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
737ece5
toc086a13
Compare4ee96eb
todc56f23
Comparedc56f23
toec41507
Compare9681e6b
to8d3eef1
CompareIn addition to the excellent work of@vincentchalamonsymfony#48272, this PR allows getting the data from the OAuth2 Introspection Endpoint. This endpoint is defined in the [RFC7662](https://datatracker.ietf.org/doc/html/rfc7662). It returns the following information that is used to retrieve the user:* If the access token is active* A set of claims that are similar to the OIDC one, including the `sub` or the `username`.
8d3eef1
toe68726f
CompareThank you@Spomky. |
1f5ff48
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
In addition to the excellent work of@vincentchalamon#48272, this PR allows getting the data from the OAuth2 Introspection Endpoint. This endpoint is defined in theRFC7662. It returns the following information that is used to retrieve the user:
sub
or theusername
.Example of configuration: