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

[Security] Import oidc.signature.key JWK from OIDC server #50434

Open
vincentchalamon opened this issue May 25, 2023 · 2 comments · May be fixed by #54932
Open

[Security] Import oidc.signature.key JWK from OIDC server #50434

vincentchalamon opened this issue May 25, 2023 · 2 comments · May be fixed by #54932

Comments

@vincentchalamon
Copy link
Contributor

Description

On OIDC (experimental) feature, the JWK must be set in the configuration (e.g.: key: %env(OIDC_JWK)%). This JWK is generated on the OIDC server. If it changes on it, its value must be updated on the Symfony project.

To access it, most OIDC servers implement a /protocol/openid-connect/certs URI exposing public JWKs used to encrypt JWTs and sign them. I suggest to import this JWK from this URI dynamically, and save it locally to prevent any extra HTTP request (app cache?).

Question: should it be a new feature or a bugfix?

Example

Current implementation:

security:
  firewalls:
    main:
      oidc:
        signature:
          key: '{"kid": "...","kty": "RSA","alg": "RS256","use": "sig","n": "3G..."}'

Proposals:

security:
  firewalls:
    main:
      oidc:
        signature:
          # proposal 1: detect value is an URI, call it to import the JWK
          key: 'https://www.example.com/protocol/openid-connect/certs'
          # proposal 2: add new option "certs" non combinable with "key" to import and set "key" option dynamically
          certs: 'https://www.example.com/protocol/openid-connect/certs'
@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@tomme87
Copy link

tomme87 commented Apr 15, 2024

ideally it should be possible to set configure a oidc discovery endpoint and use the jwks_uri to fetch the keys.
Also it should be cacheable.

@vincentchalamon vincentchalamon linked a pull request May 15, 2024 that will close this issue
10 tasks
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.

4 participants