public interface IdentityService
Modifier and Type | Method and Description |
---|---|
Object |
associate(UserIdentity user)
Associate a user identity with the current thread.
|
void |
disassociate(Object previous)
Disassociate the user identity from the current thread
and restore previous identity.
|
UserIdentity |
getSystemUserIdentity() |
RunAsToken |
newRunAsToken(String runAsName)
Create a new RunAsToken from a runAsName (normally a role).
|
UserIdentity |
newUserIdentity(Subject subject,
Principal userPrincipal,
String[] roles)
Create a new UserIdentity for use with this identity service.
|
Object |
setRunAs(UserIdentity user,
RunAsToken token)
Associate a runas Token with the current user and thread.
|
void |
unsetRunAs(Object token)
Disassociate the current runAsToken from the thread
and reassociate the previous token.
|
static final String[] NO_ROLES
Object associate(UserIdentity user)
SecurityHandler.handle(String, Request, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method and then again with a null argument as that call exits.user
- The current user or null for no user to associated.void disassociate(Object previous)
previous
- The opaque object returned from a call to associate(UserIdentity)
Object setRunAs(UserIdentity user, RunAsToken token)
user
- The UserIdentitytoken
- The runAsToken to associate.void unsetRunAs(Object token)
token
- RUNAS returned from previous associateRunAs callUserIdentity newUserIdentity(Subject subject, Principal userPrincipal, String[] roles)
subject
- Subject to include in UserIdentityuserPrincipal
- Principal to include in UserIdentity. This will be returned from getUserPrincipal callsroles
- set of roles to include in UserIdentity.RunAsToken newRunAsToken(String runAsName)
runAsName
- Normally a role nameUserIdentity getSystemUserIdentity()
Copyright © 1995-2015 Webtide. All Rights Reserved.