-
Notifications
You must be signed in to change notification settings - Fork 3k
Support flow-specific OIDC request and response filters #49122
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
Support flow-specific OIDC request and response filters #49122
Conversation
michalvavrik
commented
Jul 27, 2025
- closes: Flow specific OIDC request/response filter support #46697
This comment has been minimized.
This comment has been minimized.
🙈 The PR is closed and the preview is expired. |
91a6fa8
to
0cc62cd
Compare
This comment has been minimized.
This comment has been minimized.
0cc62cd
to
8d69553
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc
Outdated
Show resolved
Hide resolved
docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc
Outdated
Show resolved
Hide resolved
docs/src/main/asciidoc/security-oidc-expanded-configuration.adoc
Outdated
Show resolved
Hide resolved
docs/src/main/asciidoc/security-oidc-expanded-configuration.adoc
Outdated
Show resolved
Hide resolved
docs/src/main/asciidoc/security-oidc-bearer-token-authentication.adoc
Outdated
Show resolved
Hide resolved
Hi @michalvavrik, I've looked at the code, and I'm not sure I follow the reason for a rather significant code update across these few extensions. First of all, why are OIDC client and client registrations extensions impacted ? The use case is about restricting for the Second, if |
When filters are collected by OIDC Common utils, they list all filters, not just filters for "OIDC Client" and "Oidc Client Registration". So the existing code queries Arc. inspect CDI beans annotations and decides what filters to keep. And then every single time it queries a hash map for only matching filters. Long story short:
But most importantly, it makes this concept extendable. I don't think it is a good idea to just patch it on OIDC extension level and next time we want something (let say for OIDC CLient or Registration) we need to make something specific for these extensions. I thought this PR provides an improvement to original implementation 🤷 but I understand that it is very subjective thing to say.
For record, it is not just |
OIDC client extension does not have any flow variability. Nor does OIDC client registration have it. What are the use cases for any of these extensions ? I know, you have put the effort, which is always appreciated. But again, a lot more is going on in this PR than this advanced case actually requires, as you know, I do prefer issue specific PRs.
This and other optimizations are sounding interesting, but they are not related to the issue this PR resolves. They are complex enough to warrant a dedicated PR |
OIDC client extension and OIDC client registry don't need to use any flow variability. If you want, you can use
I am ready to rewrite it to your implementation suggestion (which will have quite little value, it just adds another map and couple of predicates, so it will be something I could had done in few hours rather than few days). That is life, no worry.
My opinion is that it is the same thing. You can't patch one thing on top of another without thinking. I implemented here one storage because that is what is needed to implemented linked feature effectively and keep current implementation extendable. If I were honest, I don't think you mentioned any good reason against this PR other than doing it current way is easier for us (for now).
Yes, it is complex, but as I mentioned above, it doesn't make sense to me to implement this feature and then do these changes. This PR enables this feature. Anyway, I'll do what you want. |
Just general note: I have mentioned it before in context of |
Not sure if it makes sense to comment on current impl. as I have to rewrite it, but OIDC & OIDC CLient & OIDC CLient Registration share certain methods like |
Hi Michal @michalvavrik, sure, please don't take it the wrong way, you write great code and have a ton of ideas, but I'm just an old and conservative person who finds it difficult to focus on the review and feel the situation is under control, when PR contains much more than the original issue requires. For example, the Discovery vs ALL filter target you mentioned, this is off topic for the issue, and I'm not too worried about doing this check on every request given that there will be 2/3 filters max in the majority of cases. We can definitely try to optimize it, but again, it is not related to restricting filters to either bearer or code flows, the problem relevant for the OIDC extension only. The other thing, that with my rather primitive approach, I'd only change one source class, And may be something in the recorder to handle the same for the discovery/jwks |
By the way, please take your time to refactor it as I'll probably have no time to review before I sign off at lunch time tomorrow sharp, and indeed keep the other changes recorded to discuss them later |
@sberyozkin I"ll implement it the way you suggest and have it ready when you are back. |
8d69553
to
2fede9d
Compare
2fede9d
to
9e1041d
Compare
9e1041d
to
1c0df37
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brilliant work @michalvavrik, thanks
docs/src/main/asciidoc/security-openid-connect-multitenancy.adoc
Outdated
Show resolved
Hide resolved
@michalvavrik It is ready to go, but I think we need to do a minor doc update similarly to what is suggested in the comment, thanks |
1c0df37
to
c234cec
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c234cec
to
c6660be
Compare
Status for workflow
|
Status for workflow
|