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

Consider custom reuse of DefaultTokenValidator #1579

Open
AndersAbel opened this issue Jul 18, 2024 · 1 comment
Open

Consider custom reuse of DefaultTokenValidator #1579

AndersAbel opened this issue Jul 18, 2024 · 1 comment

Comments

@AndersAbel
Copy link
Member

The DefaultTokenValidator class is internal and not possible to derive from. It is also not designed to be extensible/adapted.

When implementing token exchange it would be useful in some scenarios to be able to reuse and customize the token validator logic. One example is a multi tenanted setup with issuer-per-tenant where token exchange is used. It is possible to implement that as a custom validator, but it would essentially just be a copy of our token validator with a custom issuer validation step.

We should consider if the DefaultTokenValidator class should be opened up to allow deriving. That would also include redesigning the class to make it easier for a derived class to alter behaviour through overrides.

@brockallen brockallen added this to the Future milestone Sep 17, 2024
@josephdecock
Copy link
Member

josephdecock commented Nov 5, 2024

Note that replacing the token validator in DI is not part of this - and we don't want to encourage it. This is only to allow for using the validator code in other contexts and extending it (specifically token exchange).

We would though want to refactor the logic into a series of methods that can individually be overridden.

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

No branches or pull requests

3 participants