-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow to customize OIDC verification #33319
Allow to customize OIDC verification #33319
Conversation
1b27643
to
12a961f
Compare
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
e0bff19
to
d2de212
Compare
This comment has been minimized.
This comment has been minimized.
Hi @pedroigor This PR supports a case of verifying Azure bearer JWT tokens such as those issued for the enterprise Azure Graph services - we have both external (see the linked issue) and internal reports about such tokens not verifiable by default, using the traditional verification techniques - specifically using public Azure tenant JWKs to verify the signatures. The reason behind it is that Azure obfuscates the This case is quite strange but Azure Graph bearer tokens can be quite widely used, and other providers might need to have similar tweaks applied. PR introduces |
Let me sort out the conflicts |
41dff77
to
a2679c8
Compare
This comment has been minimized.
This comment has been minimized.
@pedroigor Let me add one more test to confirm that the random token headers update will cause the verification failure |
a2679c8
to
be9769c
Compare
@pedroigor I added one more test by modifying Good point in general, do we really need a new interface given that the only real world use case so far is the Azure Graph V1 token verification. It feels right, as we can cleanly encapsulate it in a Azure specific implementation and Id not be surprised at all we'd have more such cases coming in, we can also let users support custom JWT header obfuscation techniques, so hopefully adding an interface will prove useful beyond this Azure special case :-). We also discussed with Georgios how to link such providers with individual tenants, not even every Azure tenant will need it, so it can be via |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/OidcBuildStep.java
Show resolved
Hide resolved
@sberyozkin I would avoid introducing an API if now we only have this use case in mind. It should be easier to just rely on the defaults and the extension being smart enough to identify if any customization should be done in order to complete the expected flows (e.g.: bearer authorization). I mean, if the use case we are trying to solve is a corner case and not aligned with the specifications, we should deal with it as such. Perhaps what we want here is to delegate to the application the token verification completely? |
Hi @pedroigor
I honestly don't know how we'd do it without encapsulating inside an interface implementation - adding somewhere in I'd not worry that it is not spec compliant, we already do quite a few things in
I'd say it is not an option :-), i.e, users can just skip Thanks |
Hey @pedroigor As far as In any case, one way or another, |
I've been considering today, if this interface should also accept a blocking request context, but I honestly can't imagine a blocking call situation during the |
@sberyozkin LGTM. I don't have a better alternative to solve this corner case. |
Hey @pedroigor Thanks for the review. Right, no ideal solution exists. I like your idea of users being totally unaware of such a possible customization with Quarkus doing in dynamically, but I'm also concerned it would need to become strongly aware of such a requirement as a result with Azure specific code branch and in reality only a user will know 100% if a given Azure JWT So we two have quite similar alternatives, but what I feel just tips it over to this PR is that a generic token customization feature is introduced and along the way Georgios have come up with Thanks for your feedback, I'll keep it open till Friday. @stuartwdouglas would you like to add something to the review ? Summary: as discussed earlier, this PR offers a way to preprocess tokens before they are verified with the Azure customizer shipped out of the box - it can be referred to as a named bean, while users are encouraged to use Thanks |
Merging now, as always, we can tune things going forward |
Fixes #32701