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

Support OIDC Redirect filters #40562

Closed
sberyozkin opened this issue May 10, 2024 · 1 comment · Fixed by #40600
Closed

Support OIDC Redirect filters #40562

sberyozkin opened this issue May 10, 2024 · 1 comment · Fixed by #40600
Assignees
Labels
area/oidc kind/enhancement New feature or request
Milestone

Comments

@sberyozkin
Copy link
Member

sberyozkin commented May 10, 2024

Description

Quarkus OIDC already has OidcRequestFilter which can be used to intercept direct requests to various OIDC endpoints.

But redirects to OIDC authorization or logout endpoints, or local redirects to the error or session expired pages can not be intercepted.

In the latter case, when, for example, a user whose session has expired, is redirected to the session expired page, it is impossible to generate such a page correctly when multiple OIDC tenants are involved, for example, given Keycloak and Auth0, the session expired page handler does not know where to link the user to, for this user to initiate a provider specific re-authentication.
The custom redirect filter can help by creating a secure cookie capturing the tenant info and the session expired page handler can use it to create a correct re-authentication link.

Or users may want to intercept redirects to the OIDC authorization endpoint itself, for example, to add some extra redirect parameters dynamically or set extra headers etc, as tried in #40547.

Note, currently, we have AuthenticationRedirectException but I'm not sure we should look at mapping such exceptions at the JAX-RS level as a standard recommended solution, as the way to manage such redirects. It won't work anyway for the multi-tenant OIDC setup since AuthenticationRedirectException can not be made aware of the OIDC tenant config.

CC @pedroigor @gastaldi @calvernaz

Implementation ideas

Add OidcRedirectFilter, use @TenantFeature to bind it to specific tenants if needed

@sberyozkin sberyozkin added the kind/enhancement New feature or request label May 10, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented May 10, 2024

/cc @pedroigor (oidc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oidc kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants