Replies: 1 comment
-
/cc @geoand (kotlin), @pedroigor (oidc), @sberyozkin (jwt,oidc) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a Quarkus 3.24 application that supports two types of authentication:
After reviewing the Quarkus documentation on supporting multiple HTTP authentication mechanisms, I implemented a custom
HttpAuthenticationMechanism
to choose between OIDC and JWT based on a custom request header (HELIX-AGENT
).However, accessing the JWT is not working as expected and results in inconsistent behavior: injecting
JsonWebToken
directly in a resource results in aNullJsonWebToken
, whereas injectingSecurityIdentity
and accessing its.principal
property correctly returns aDefaultJwtCallerPrincipal
containing the expected claims from the self-issued JWT.Custom Mechanism Implementation
Problem
After a client logs in, it receives a JWT like this:
The client then includes this token in future requests to the API, along with the HELIX-AGENT header to indicate that it is a client and not a user.
Although the JWT authentication mechanism is selected based on the header, OIDC still appears to be invoked and attempts to parse or introspect the JWT, leading to warnings such as the following:
Additionally, injecting
JsonWebToken
into a resource results in aNullJsonWebToken
, even though injectingSecurityIdentity
and accessing its.principal
property reveals aDefaultJwtCallerPrincipal
containing all the expected data from the self-issued JWT.Questions
JsonWebToken
injection resulting in aNullJsonWebToken
, even thoughSecurityIdentity.principal
contains a validDefaultJwtCallerPrincipal
with all expected claims?Best regards,
Artur
Beta Was this translation helpful? Give feedback.
All reactions