How to access the security roles of a user / principal in JBoss EAP
Issue
- We would like to know how to access the security roles of a successfully authenticated user.
There are two places in HttpSessionRequest where roles are stated but not accessible:
Request->userPrincipal->roles
Request->session->principal->roles
Either these attributes are protected or private and hence not accessible or we want to know a correct way to access them.
Environment
- JBoss Enterprise Application Platform (EAP)
- all versions
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.