public class DefaultIdentityService extends java.lang.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, org.eclipse.jetty.server.UserIdentity.Scope)
implementation. All other operations are effectively noops.NO_ROLES
Constructor and Description |
---|
DefaultIdentityService() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
associate(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, org.eclipse.jetty.server.UserIdentity.Scope) |
void |
disassociate(java.lang.Object previous)
Disassociate the user identity from the current thread
and restore previous identity.
|
UserIdentity |
getSystemUserIdentity() |
RunAsToken |
newRunAsToken(java.lang.String runAsName)
Create a new RunAsToken from a runAsName (normally a role).
|
UserIdentity |
newUserIdentity(javax.security.auth.Subject subject,
java.security.Principal userPrincipal,
java.lang.String[] roles)
Create a new UserIdentity for use with this identity service.
|
java.lang.Object |
setRunAs(UserIdentity user,
RunAsToken token)
Associate a runas Token with the current user and thread.
|
void |
unsetRunAs(java.lang.Object lastToken)
Disassociate the current runAsToken from the thread
and reassociate the previous token.
|
public java.lang.Object associate(UserIdentity user)
UserIdentity.isUserInRole(String, org.eclipse.jetty.server.UserIdentity.Scope)
associate
in interface IdentityService
user
- The current user or null for no user to associated.public void disassociate(java.lang.Object previous)
IdentityService
disassociate
in interface IdentityService
previous
- The opaque object returned from a call to IdentityService.associate(UserIdentity)
public java.lang.Object setRunAs(UserIdentity user, RunAsToken token)
IdentityService
setRunAs
in interface IdentityService
user
- The UserIdentitytoken
- The runAsToken to associate.public void unsetRunAs(java.lang.Object lastToken)
IdentityService
unsetRunAs
in interface IdentityService
lastToken
- RUNAS returned from previous associateRunAs callpublic RunAsToken newRunAsToken(java.lang.String runAsName)
IdentityService
newRunAsToken
in interface IdentityService
runAsName
- Normally a role namepublic UserIdentity getSystemUserIdentity()
getSystemUserIdentity
in interface IdentityService
public UserIdentity newUserIdentity(javax.security.auth.Subject subject, java.security.Principal userPrincipal, java.lang.String[] roles)
IdentityService
newUserIdentity
in interface IdentityService
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.Copyright © 1995–2023 Webtide. All rights reserved.