public class JBossSecurityContextUtil extends SecurityContextUtil
securityContext| Constructor and Description |
|---|
JBossSecurityContextUtil(SecurityContext sc) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(String key)
Return an object from the Security Context
|
Object |
getCredential()
Get the credential
|
RoleGroup |
getRoles()
Get the Roles associated with the user for the
current security context
|
SecurityIdentity |
getSecurityIdentity()
Get a holder of subject, runAs and caller RunAs
|
Subject |
getSubject()
Get the subject the security context
|
String |
getUserName()
Get the username from the security context
|
Principal |
getUserPrincipal()
Get the user principal the security context
|
<T> T |
remove(String key)
Remove an object represented by the key from the security context
|
<T> void |
set(String key,
T obj)
Set an object on the Security Context
The context implementation may place the object in its internal
data structures (like the Data Map)
|
void |
setRoles(RoleGroup roles)
Set the roles for the user for the current security context
|
void |
setSecurityIdentity(SecurityIdentity sidentity)
Inject subject, runAs and callerRunAs into the security context
Mainly used by integration code base to cache the security identity
and put back to the security context
|
addIdentity, clearIdentities, createSubjectInfo, createSubjectInfo, getIdentities, setIdentities, setSecurityContextpublic JBossSecurityContextUtil(SecurityContext sc)
public <T> T get(String key)
SecurityContextUtilget in class SecurityContextUtilkey - key identifies the type of object we are requestingpublic String getUserName()
SecurityContextUtilgetUserName in class SecurityContextUtilpublic Principal getUserPrincipal()
SecurityContextUtilgetUserPrincipal in class SecurityContextUtilpublic Object getCredential()
SecurityContextUtilgetCredential in class SecurityContextUtilpublic Subject getSubject()
SecurityContextUtilgetSubject in class SecurityContextUtilpublic <T> void set(String key, T obj)
SecurityContextUtilset in class SecurityContextUtilT - Generic Typekey - Key representing the object being setpublic <T> T remove(String key)
SecurityContextUtilremove in class SecurityContextUtilkey - key identifies the type of object we are requestingpublic void setRoles(RoleGroup roles)
SecurityContextUtilsetRoles in class SecurityContextUtilpublic void setSecurityIdentity(SecurityIdentity sidentity)
SecurityContextUtilsetSecurityIdentity in class SecurityContextUtilsidentity - The SecurityIdentity Objectpublic SecurityIdentity getSecurityIdentity()
SecurityContextUtilgetSecurityIdentity in class SecurityContextUtilpublic RoleGroup getRoles()
SecurityContextUtilgetRoles in class SecurityContextUtilCopyright © 2016 JBoss by Red Hat. All rights reserved.