How to access the security roles of a user / principal in JBoss EAP

Solution Verified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content