CDI scope/context in custom implementation of JWTCallerPrincipalFactory #44828
Unanswered
martin-kofoed-jyskebank-dk
asked this question in
Q&A
Replies: 2 comments 3 replies
-
/cc @Ladicek (arc), @manovotn (arc), @mkouba (arc), @sberyozkin (jwt) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Would you be able to create a small, self-contained reproducer? From the text, I myself cannot figure out where the problem can be. |
Beta Was this translation helpful? Give feedback.
3 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.
-
Hi,
I've implemented a custom JWT caller principal factory like mentioned in the RBAC documentation here, and I have experienced some weird behaviour that could be a bug - or at least something that should have a note in the docs.
I'm trying to propagate a user ID extracted from JWT claim after succesful validation for use in a
@ServerRequestFilter
. So I have declared a@RequestScoped
bean to hold the user data. This bean is injected in my@ApplicationScoped
JWT caller principal as well as in the server filter. I would expect it to be instantiated only once.Instead, I see the following life cycle:
Is this expected behaviour? And if so: are there any other recommended ways to transfer data from a JWT factory down the stream?
Running Quarkus 3.16.4
Kind regards,
Martin
Beta Was this translation helpful? Give feedback.
All reactions