-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Support for customizing request and response body in OIDC filters #49042
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 for customizing request and response body in OIDC filters #49042
Conversation
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.
Pull Request Overview
This PR implements support for customizing request and response bodies in OIDC filters by adding new constants to OidcRequestContextProperties
and modifying the filtering mechanism to check for and apply custom request/response bodies through shared context properties.
- Adds
REQUEST_BODY
andRESPONSE_BODY
constants toOidcRequestContextProperties
for filter customization - Updates filtering logic across OIDC components to support custom request/response body handling
- Provides comprehensive documentation and test coverage for the new functionality
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
OidcRequestContextProperties.java | Adds new constants for request and response body customization |
OidcCommonUtils.java | Implements utility methods for handling custom request/response bodies |
Various OIDC runtime files | Updates filtering calls to use new body customization support |
Test files | Adds integration tests demonstrating request/response body customization |
Documentation files | Updates documentation with examples of the new filtering capabilities |
Comments suppressed due to low confidence (1)
docs/src/main/asciidoc/security-openid-connect-client-registration.adoc:569
- [nitpick] Class name 'ClientRegistrationReRequestFilter' contains 'ReRequest' which appears to be a typo. Consider 'ClientRegistrationRequestFilter' instead.
public class ClientRegistrationReRequestFilter implements OidcRequestFilter {
docs/src/main/asciidoc/security-openid-connect-client-registration.adoc
Outdated
Show resolved
Hide resolved
9f25a4b
to
46435be
Compare
Thanks @gastaldi, Copilot was helpful yet again, I was copying/pasting some code examples across several docs and ended up with some non-compiling code in one of the docs :-) |
This comment has been minimized.
This comment has been minimized.
🙈 The PR is closed and the preview is expired. |
Sorry, looks like NPE is showing up, in some cases, the code I added assumes the buffer that is checked is never null |
This comment has been minimized.
This comment has been minimized.
46435be
to
d0fdde0
Compare
Sorry again, so |
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.
I just spend last hours modifying similar classes #46697 so I am not super happy to see this PR 😀 but it looks fine. I left one opinion as I'd implement it differently, but it's optional. LGTM.
docs/src/main/asciidoc/security-oidc-code-flow-authentication.adoc
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d0fdde0
to
50b1a85
Compare
Status for workflow
|
Status for workflow
|
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.
Thanks!
Fixes #49041.
Fixes #40258.
This PR provides a simple option for
OidcRequestFilter
implementations to customize a request body and forOidcResponseFilter
implementations to customize a response body, by depending on a sharedOidcRequestContextProperties
map as a medium to pass the updated content back to the runtime