Skip to content
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

JWKSet support for OIDCTokenHandler #53491

Closed
adzfaulkner opened this issue Jan 10, 2024 · 8 comments
Closed

JWKSet support for OIDCTokenHandler #53491

adzfaulkner opened this issue Jan 10, 2024 · 8 comments

Comments

@adzfaulkner
Copy link

adzfaulkner commented Jan 10, 2024

Description

We would like to use the symfony/security-http OIDCTokenHandler but the Identity and Access Management system currently employed exposes a JWK Keyset via it's realm certs url as opposed to a single JWK of which the token hander in question only currently supports.

It would be great if the OIDCTokenHandler could also accept an instance of JWKSet to be passed into it's constuctor which will also incur modifications in how the jms is verified.

Example

final class OidcTokenHandler implements AccessTokenHandlerInterface
{
    use OidcTrait;

    public function __construct(
        private Algorithm $signatureAlgorithm,
-       private JWK$jwk,
+       private JWK|JWKSet $jwk,
        private string $audience,
        private array $issuers,
        private string $claim = 'sub',
        private ?LoggerInterface $logger = null,
        private ClockInterface $clock = new Clock()
    ) {
    }
}
@chalasr
Copy link
Member

chalasr commented Jan 10, 2024

Possible duplicate of #50434

@chalasr chalasr closed this as completed Jan 10, 2024
@chalasr
Copy link
Member

chalasr commented Jan 10, 2024

I didn't mean to close as I'm not entirely sure it's the same feature request. Can you please confirm @adzfaulkner?

@adzfaulkner
Copy link
Author

@chalasr I can confirm it's not a duplicate as the suspected related ticket refers to downloading a single key from a certs URL as opposed to my request which is JWKSet support to be added to the underlying Token Handler

@OskarStark
Copy link
Contributor

I made the example in the PR header a diff to be more readable, can you confirm my change is correct? Thanks

@OskarStark OskarStark changed the title OIDCTokenHandler JWKSet support JWKSet support for OIDCTokenHandler Jan 10, 2024
@adzfaulkner
Copy link
Author

@OskarStark spot on thank you :-)

@louismariegaborit
Copy link
Contributor

louismariegaborit commented Jan 22, 2024

I worked few months ago on this #51665. 😉

@louismariegaborit
Copy link
Contributor

I think this issue was resolved by #53682.

@adzfaulkner
Copy link
Author

@louismariegaborit your assertion looks correct. Hence issue has been closed. Cheers for the hard work to make it happen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants