Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[SecurityBundle] Improve support for authenticators that don't need a user provider#48594

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

Merged
chalasr merged 1 commit intosymfony:6.3fromwouterj:security-no-user-provider
Dec 18, 2022

Conversation

wouterj
Copy link
Member

@wouterjwouterj commentedDec 10, 2022
edited
Loading

QA
Branch?6.3
Bug fix?no
New feature?yes
Deprecations?no
TicketsRef#48285,#48272
LicenseMIT
Doc PR-

This builds on top of the self-contained token feature added in 6.2 (#48285). While that PR allows access token handlers to load the user from the access token without user provider, it was still required to configure a user provider in the code.

With this PR, the bundle allows a user provider to not be configured when:

  1. The firewall isstateless, otherwise we still need the user provider to refresh the user
  2. The authenticator factory implementsStatelessAuthenticatorFactoryInterface (i.e. declares compatibility with no user provider)

This can help with simplifying the code in#48272 (comment) , as we no longer have to define a special user badge and provider.

cc@Jeroeny

yceruto, Jeroeny, and Spomky reacted with thumbs up emoji
@chalasr
Copy link
Member

Neat!

Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

With changelog entry

@chalasrchalasrforce-pushed thesecurity-no-user-provider branch from6015ad0 to5464c57CompareDecember 18, 2022 14:14
@chalasr
Copy link
Member

Merging now to help moving forward in#48272.
Side note: I think we'll need to double-check that the webprofiler isn't broken when there's no provider, and also maybe improve the security panel by making it expose the statelessness of the authenticator.

@chalasr
Copy link
Member

Thank you@wouterj.

@chalasrchalasr merged commita27e37a intosymfony:6.3Dec 18, 2022
@wouterjwouterj deleted the security-no-user-provider branchJanuary 26, 2023 17:10
fabpot added a commit that referenced this pull requestApr 14, 2023
…vincentchalamon)This PR was squashed before being merged into the 6.3 branch.Discussion----------[Security] Add OidcUserInfoTokenHandler and OidcUser| Q             | A| ------------- | ---| Branch?       | 6.3| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       | N/A| License       | MIT| Doc PR        |symfony/symfony-docs#17463Hi,This PR aims to complete [the previous one](#46428) from `@Spomky` with an AccessTokenHandler ready-to-use with an OIDC server (Keycloak, Auth0).## TODO- [x] Rebase from 6.3- [x] Rebase from#48285- [x] Rebase from#48594- [x] Write doc (symfony/symfony-docs#17463)- [x] Add TokenHandlerFactory- [x] Add ServiceTokenHandlerFactory for BC layer- [x] Add OidcUserInfoTokenHandlerFactory- [x] Add OidcTokenHandlerFactory (using web-token/jwt-*)- [x] Implement OidcUser to keep user claims from OIDC server- [x] Update doc PR about claims usage in a custom UserProvider- [x] ~Update doc PR about OidcUserProvider usage~ (abandonned)## Usage```yaml# usage with a custom clientsecurity:    firewalls:        main:            pattern: ^/            access_token:                token_handler:                    oidc_user_info:                        client: oidc.client``````yaml# usage with generic HttpClientsecurity:    firewalls:        main:            pattern: ^/            access_token:                token_handler:                    oidc_user_info:                        claim: email                        client:                            base_uri:https://www.example.com/realms/demo/protocol/openid-connect/userinfo``````yaml# usage with token decode (no call to OIDC server)security:    firewalls:        main:            pattern: ^/            access_token:                token_handler:                    oidc:                        signature:                            # Algorithm used to sign the JWS                            algorithm: 'HS256'                            # A JSON-encoded JWK                            key: '{"kty":"...","k":"..."}'``````php# usage with a custom UserProviderclass CustomUserProvider implements UserProviderInterface{    public function loadUserByIdentifier(string $identifier, array $claims = []): UserInterface    {        // do some magic    }}```Commits-------99a35f0 [Security] Add OidcUserInfoTokenHandler and OidcUser
@fabpotfabpot mentioned this pull requestMay 1, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@chalasrchalasrchalasr approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
6.3
Development

Successfully merging this pull request may close these issues.

3 participants
@wouterj@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp