Top Description Fields Constructors Methods
org.eclipse.jetty.security

public abstract Class AbstractLoginService

extends ContainerLifeCycle
implements LoginService
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.security.LoginService
Known Direct Subclasses
org.eclipse.jetty.security.HashLoginService, org.eclipse.jetty.security.JDBCLoginService
Imports
java.util.ArrayList, .List, java.util.function.Function, javax.security.auth.Subject, org.eclipse.jetty.server.Request, .Session, org.eclipse.jetty.util.component.ContainerLifeCycle

AbstractLoginService Base class for LoginServices that allows subclasses to provide the user authentication and authorization information, but provides common behaviour such as handling authentication.

Field Summary

Modifier and TypeField and Description
protected boolean
protected IdentityService
protected String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public IdentityService
getIdentityService()

Implements org.eclipse.jetty.security.LoginService.getIdentityService.

Get the IdentityService associated with this Login Service.

public String
public boolean
protected abstract List<RolePrincipal>
protected abstract UserPrincipal
loadUserInfo(String username)

public UserIdentity
login(String
The username.
username
,
Object
The users credentials.
credentials
,
Request
The request or null
request
,
Function<Boolean, Session>
function to retrieve or create a session.
getOrCreateSession
)

Implements org.eclipse.jetty.security.LoginService.login.

Login a user.

public void
public void
setFullValidate(boolean fullValidate)

public void
setIdentityService(IdentityService
the identityService to set
identityService
)

Implements org.eclipse.jetty.security.LoginService.setIdentityService.

Set the identityService.

public void
setName(String
the name to set
name
)

Set the name.

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.

public boolean
validate(UserIdentity
The user to validate
user
)

Implements org.eclipse.jetty.security.LoginService.validate.

Validate a user identity.

Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydoStartdoStopdumpdumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans

Field Detail

_fullValidateback to summary
protected boolean _fullValidate
_identityServiceback to summary
protected IdentityService _identityService
_nameback to summary
protected String _name

Constructor Detail

AbstractLoginServiceback to summary
protected AbstractLoginService()

Method Detail

getIdentityServiceback to summary
public IdentityService getIdentityService()

Implements org.eclipse.jetty.security.LoginService.getIdentityService.

Doc from org.eclipse.jetty.security.LoginService.getIdentityService.

Get the IdentityService associated with this Login Service.

Returns:IdentityService

the IdentityService associated with this Login Service.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.eclipse.jetty.security.LoginService.getName.

Returns:String

Doc from org.eclipse.jetty.security.LoginService.getName.

Get the name of the login service (aka Realm name)

Annotations
@Override
isFullValidateback to summary
public boolean isFullValidate()
loadRoleInfoback to summary
protected abstract List<RolePrincipal> loadRoleInfo(UserPrincipal user)
loadUserInfoback to summary
protected abstract UserPrincipal loadUserInfo(String username)
loginback to summary
public UserIdentity login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession)

Implements org.eclipse.jetty.security.LoginService.login.

Doc from org.eclipse.jetty.security.LoginService.login.

Login a user.

Parameters
username:String

The username.

credentials:Object

The users credentials.

request:Request

The request or null

getOrCreateSession:Function<Boolean, Session>

function to retrieve or create a session.

Returns:UserIdentity

A UserIdentity if the credentials matched, otherwise null

Annotations
@Override
logoutback to summary
public void logout(UserIdentity user)

Implements org.eclipse.jetty.security.LoginService.logout.

Annotations
@Override
setFullValidateback to summary
public void setFullValidate(boolean fullValidate)
setIdentityServiceback to summary
public void setIdentityService(IdentityService identityService)

Implements org.eclipse.jetty.security.LoginService.setIdentityService.

Set the identityService.

Parameters
identityService:IdentityService

the identityService to set

Annotations
@Override
setNameback to summary
public void setName(String name)

Set the name.

Parameters
name:String

the name to set

toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
validateback to summary
public boolean validate(UserIdentity user)

Implements org.eclipse.jetty.security.LoginService.validate.

Doc from org.eclipse.jetty.security.LoginService.validate.

Validate a user identity. Validate that a UserIdentity previously created by a call to login(String, Object, Request, Function) is still valid.

Parameters
user:UserIdentity

The user to validate

Returns:boolean

true if authentication has not been revoked for the user.

Annotations
@Override