Skip to content
Discussion options

You must be logged in to vote

Hi,

by looking at the impl. of @RolesAllowed in quarkus (as it does a similar thing) I meanwhile found a way that works for me:

@Inject
SecurityIdentityAssociation identity;
String subject = identity.getIdentity().getPrincipal().getName()

That works if the context is secured (I use @testsecurity to login a user) and the respective @CheckPermission annotation can be applied to JAX-RS endpoints as well as plain Java methods.

So my problem is actually resolved and my question is answered (as long as there are no objections against my solution).

Thx

Replies: 4 comments 3 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
2 replies
@sberyozkin
Comment options

@joerg-db
Comment options

Answer selected by joerg-db
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
Category
Q&A
Labels
None yet
3 participants