Allow to customize OIDC JavaRequest checks #34812
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is about making it easier for SPA developers to tell Quarkus that XHR/Fetch issued the call - currently they have to set up a header in the script - but if the script engine already sets some header of its own then making this check from a custom
JavaScriptRequestChecker
bean simplifies the scripts, avoids the creation of redundant headers.This PR is only about supporting this check at the server side. As documented, SPA may need to reload the page if Keycloak or other providers do not support CORS in their authorization endooints - so Quarkus can help with issuing 499 error (instead of redirects) if it is allowed to do so for JavaScript requests - SPA catch it and reload the page bypassing CORS restrictions in Keycloak.
So
JavaScriptRequestChecker
is introduced, tests and docs updated.