Skip to content

How to @Inject JsonWebToken when having both quarkus-smallrye-jwt and quarkus-oidc in Quarkus application #33976

Answered by sberyozkin
trunghoangminh asked this question in Q&A
Discussion options

You must be logged in to vote

@trunghoangminh

Can you try configuring a path based authentication:
https://quarkus.io/guides/security-authentication-mechanisms-concept#path-specific-authentication-mechanisms

bearer mechanism provided by smallrye-jwt would cover the local authentication paths, code (it is not mentioned in those docs though) provided by quarkus-oidc would cover the path requiring Keycloak authentication.

I'm not sure though it will fix the ambiguity with JsonWebToken producers, both quarkus-smallrye-jwt and quarkus-oidc provide bearer token authentication and support this injection without @IdToken qualifier.

I think the best solution should be to have SecurityIdentity injected instead for the local aut…

Replies: 7 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by trunghoangminh
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sberyozkin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment