Top Description Methods
org.eclipse.jetty.security

public Interface UserIdentity

Known Direct Implementers
org.eclipse.jetty.security.internal.DefaultUserIdentity, org.eclipse.jetty.security.RoleDelegateUserIdentity
Imports
java.security.Principal, javax.security.auth.Subject, org.eclipse.jetty.security.internal.DefaultUserIdentity

User object that encapsulates user identity and operations such as run-as-role actions, checking isUserInRole and getUserPrincipal.

Implementations of UserIdentity should be immutable so that they may be cached by Authenticators and LoginServices.

Method Summary

Modifier and TypeMethod and Description
public static UserIdentity
from(Subject subject, Principal userPrincipal, String... roles)

public Subject
getSubject()

Returns: The user subject

public Principal
getUserPrincipal()

Returns: The user principal

public boolean

Returns:

True if the user can act in that role.
isUserInRole
(String
A role name.
role
)

Check if the user is in a role.

Method Detail

fromback to summary
public static UserIdentity from(Subject subject, Principal userPrincipal, String... roles)
getSubjectback to summary
public Subject getSubject()
Returns:Subject

The user subject

getUserPrincipalback to summary
public Principal getUserPrincipal()
Returns:Principal

The user principal

isUserInRoleback to summary
public boolean isUserInRole(String role)

Check if the user is in a role. This call is used to satisfy authorization calls from container code which will be using translated role names.

Parameters
role:String

A role name.

Returns:boolean

True if the user can act in that role.