Skip to content

Custom JWKS Uri resolution function for WithIssuersResolver #387

@springroll12

Description

@springroll12

Checklist

Describe the problem you'd like to have solved

With a dynamic issuer configuration via validator.WithIssuerResolver it does not seem possible to specify a non-standard JWKS endpoint for each issuer. What would be handy is a similar function validator.WithJWKSResolver or an additional return value to WithIssuerResolver that sets the custom JWKS endpoint rather than relying on discovery.

In our case we need the dynamic nature of MultiIssuerProvider and WithIssuerResolver, but also need to set custom JWKS endpoints per issuer. These endpoints follow a simple pattern, but there doesn't appear to be an interface to set this. With static issuers this is possible, but unless I'm mistaken it is not with the new MCD implementation. My primary use case is to exchange the full external issuer domain for an internal domain (e.g. Kubernetes service domain). This is particularly useful when testing on localhost.

Describe the ideal solution

WithIssuerResolver allows configuring more details tied to the issuer. E.g. JWKS uri, or strict hostname matching and so forth.

Alternatives and current workarounds

  • Set static issuers and be unable to customize per tenant.
  • Create custom provider?

Additional context

Really love the new MCD implementation! Very clean implementation!

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA feature has been asked for or suggested by the community

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions