-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[Security] Allow multiple OIDC discovery endpoints #62043
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
base: 7.4
Are you sure you want to change the base?
[Security] Allow multiple OIDC discovery endpoints #62043
Conversation
13696f9
to
c6bcc32
Compare
...y/Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OidcTokenHandlerFactory.php
Outdated
Show resolved
Hide resolved
c6bcc32
to
50c135a
Compare
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.
Do we want to keep synchronous HTTP calls? Shouldn't we do concurrent ones?
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
I like it, will check it out! Thanks for the review 🙏 |
But how to do that, in combination with the Symfony Cache callbacks? They have their own cache, so they could also be evicted separately etc. |
783e73c
to
102be5e
Compare
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.
Do we want to keep synchronous HTTP calls? Shouldn't we do concurrent ones?
But how to do that, in combination with the Symfony Cache callbacks?
They have their own cache, so they could also be evicted separately etc.
Let's have a single cache entry. I don't see the need for many 🤷
...le/Tests/DependencyInjection/Fixtures/php/access_token_oidc_user_info_multiple_discovery.php
Outdated
Show resolved
Hide resolved
...y/Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OidcTokenHandlerFactory.php
Outdated
Show resolved
Hide resolved
When a firewall accepts tokens from multiple identity providers, it needs to validate tokens against different OIDC discovery endpoints. This change allows configuring multiple named discovery servers instead of just one, while keeping backward compatibility.
6f4ee9c
to
bbecc4d
Compare
...y/Bundle/SecurityBundle/DependencyInjection/Security/AccessToken/OidcTokenHandlerFactory.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
…Handler.php Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Show resolved
Hide resolved
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.
Some minor tweaks then LGTM, thanks.
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/AccessToken/Oidc/OidcTokenHandler.php
Outdated
Show resolved
Hide resolved
(well, please check tests before :) |
…Handler.php Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
…Handler.php Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
Alright, it's ready ! |
When a firewall accepts tokens from multiple identity providers, it needs to validate tokens against different OIDC discovery endpoints. This change allows configuring multiple named discovery servers instead of just one, while keeping backward compatibility.
With this change, we allow configuring multiple discovery endpoints with different (or the same) cache storage. They all use a different cache key.
It then builds a JWTSet of all the keys fetched, from the multiple endpoints, and then validates the JWT against that total JWTSet.
/cc @vincentchalamon @Jean-Beru @chalasr @Spomky Tagging you as you were all involved in previous OIDC PR's. Curious to hear your opinions about this 🙏