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, setSecurityContext
public JBossSecurityContextUtil(SecurityContext sc)
public <T> T get(String key)
SecurityContextUtil
get
in class SecurityContextUtil
key
- key identifies the type of object we are requestingpublic String getUserName()
SecurityContextUtil
getUserName
in class SecurityContextUtil
public Principal getUserPrincipal()
SecurityContextUtil
getUserPrincipal
in class SecurityContextUtil
public Object getCredential()
SecurityContextUtil
getCredential
in class SecurityContextUtil
public Subject getSubject()
SecurityContextUtil
getSubject
in class SecurityContextUtil
public <T> void set(String key, T obj)
SecurityContextUtil
set
in class SecurityContextUtil
T
- Generic Typekey
- Key representing the object being setpublic <T> T remove(String key)
SecurityContextUtil
remove
in class SecurityContextUtil
key
- key identifies the type of object we are requestingpublic void setRoles(RoleGroup roles)
SecurityContextUtil
setRoles
in class SecurityContextUtil
public void setSecurityIdentity(SecurityIdentity sidentity)
SecurityContextUtil
setSecurityIdentity
in class SecurityContextUtil
sidentity
- The SecurityIdentity Objectpublic SecurityIdentity getSecurityIdentity()
SecurityContextUtil
getSecurityIdentity
in class SecurityContextUtil
public RoleGroup getRoles()
SecurityContextUtil
getRoles
in class SecurityContextUtil
Copyright © 2018 JBoss by Red Hat. All rights reserved.