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

fix(translator): make OIDC and JWT authentication work together #5142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

StephenRobin
Copy link

What type of PR is this?

What this PR does / why we need it:
Currently, when both OIDC and JWT authentication mechanisms are configured in the same SecurityPolicy, the OIDC is applied first. It ensures the presence of the bearer and refresh tokens in cookies, and adds the Authorisation header to the request. Then JWT is applied, validating the added header.

This setup works perfectly for browser requests. However, it blocks requests from clients that provide a valid "Authorization: Bearer..." header (normally non-browser clients). The OIDC mechanism kicks in first and redirects the requests to the login pages because of the missing cookies.

Use Envoy Gateway's pass_through_matcher option to skip over the OIDC filter when the request is going to be handled by the JWT filter later.

Which issue(s) this PR fixes:

Fixes #2496

Release Notes: Yes

@StephenRobin StephenRobin requested a review from a team as a code owner January 24, 2025 13:09
Currently, when both OIDC and JWT authentication mechanisms are configured in
the same SecurityPolicy, the OIDC is applied first. It ensures the presence of
the bearer and refresh tokens in cookies, and adds the Authorisation header to
the request. Then JWT is applied, validating the added header.

This setup works perfectly for browser requests. However, it blocks requests
from clients that provide a valid "Authorization: Bearer..." header (normally
non-browser clients). The OIDC mechanism kicks in first and redirects the
requests to the login pages because of the missing cookies.

Use Envoy Gateway's pass_through_matcher option to skip over the OIDC filter
when the request is going to be handled by the JWT filter later.

Signed-off-by: Stephen Robin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters for OIDC authentication mechanisms
1 participant