public class DefaultIdentityService extends Object implements IdentityService
UserIdentity.Scope. If there are roles
refs present, then associate will wrap the UserIdentity with one
that uses the role references in the
UserIdentity.isUserInRole(String, UserIdentity.Scope)
implementation. All other operations are effectively noops.NO_ROLES| 构造器和说明 |
|---|
DefaultIdentityService() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
associate(org.eclipse.jetty.server.UserIdentity user)
If there are roles refs present in the scope, then wrap the UserIdentity
with one that uses the role references in the
UserIdentity.isUserInRole(String, UserIdentity.Scope) |
void |
disassociate(Object previous)
Disassociate the user identity from the current thread
and restore previous identity.
|
org.eclipse.jetty.server.UserIdentity |
getSystemUserIdentity() |
RunAsToken |
newRunAsToken(String runAsName)
Create a new RunAsToken from a runAsName (normally a role).
|
org.eclipse.jetty.server.UserIdentity |
newUserIdentity(Subject subject,
Principal userPrincipal,
String[] roles)
Create a new UserIdentity for use with this identity service.
|
Object |
setRunAs(org.eclipse.jetty.server.UserIdentity user,
RunAsToken token)
Associate a runas Token with the current user and thread.
|
void |
unsetRunAs(Object lastToken)
Disassociate the current runAsToken from the thread
and reassociate the previous token.
|
public Object associate(org.eclipse.jetty.server.UserIdentity user)
UserIdentity.isUserInRole(String, UserIdentity.Scope)associate 在接口中 IdentityServiceuser - The current user or null for no user to associated.public void disassociate(Object previous)
IdentityServicedisassociate 在接口中 IdentityServiceprevious - The opaque object returned from a call to IdentityService.associate(UserIdentity)public Object setRunAs(org.eclipse.jetty.server.UserIdentity user, RunAsToken token)
IdentityServicesetRunAs 在接口中 IdentityServiceuser - The UserIdentitytoken - The runAsToken to associate.public void unsetRunAs(Object lastToken)
IdentityServiceunsetRunAs 在接口中 IdentityServicelastToken - RUNAS returned from previous associateRunAs callpublic RunAsToken newRunAsToken(String runAsName)
IdentityServicenewRunAsToken 在接口中 IdentityServicerunAsName - Normally a role namepublic org.eclipse.jetty.server.UserIdentity getSystemUserIdentity()
getSystemUserIdentity 在接口中 IdentityServicepublic org.eclipse.jetty.server.UserIdentity newUserIdentity(Subject subject, Principal userPrincipal, String[] roles)
IdentityServicenewUserIdentity 在接口中 IdentityServicesubject - Subject to include in UserIdentityuserPrincipal - Principal to include in UserIdentity. This will be returned from getUserPrincipal callsroles - set of roles to include in UserIdentity.Copyright © 2017. All rights reserved.