Package org.eclipse.jetty.security
Class AbstractLoginService
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.security.AbstractLoginService
- All Implemented Interfaces:
LoginService
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
- Direct Known Subclasses:
DataSourceLoginService
,HashLoginService
,JDBCLoginService
AbstractLoginService
Base class for LoginServices that allows subclasses to provide the user authentication and authorization information,
but provides common behaviour such as handling authentication.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the IdentityService associated with this Login Service.getName()
boolean
protected abstract List<RolePrincipal>
loadRoleInfo
(UserPrincipal user) protected abstract UserPrincipal
loadUserInfo
(String username) Login a user.void
logout
(UserIdentity user) void
setFullValidate
(boolean fullValidate) void
setIdentityService
(IdentityService identityService) Set the identityService.void
Set the name.toString()
boolean
validate
(UserIdentity user) Validate a user identity.Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
_identityService
-
_name
-
_fullValidate
protected boolean _fullValidate
-
-
Constructor Details
-
AbstractLoginService
protected AbstractLoginService()
-
-
Method Details
-
loadRoleInfo
-
loadUserInfo
-
getName
- Specified by:
getName
in interfaceLoginService
- Returns:
- Get the name of the login service (aka Realm name)
-
setIdentityService
Set the identityService.- Specified by:
setIdentityService
in interfaceLoginService
- Parameters:
identityService
- the identityService to set
-
setName
Set the name.- Parameters:
name
- the name to set
-
toString
- Overrides:
toString
in classAbstractLifeCycle
-
login
public UserIdentity login(String username, Object credentials, jakarta.servlet.ServletRequest request) Description copied from interface:LoginService
Login a user.- Specified by:
login
in interfaceLoginService
- Parameters:
username
- The user namecredentials
- The users credentialsrequest
- TODO- Returns:
- A UserIdentity if the credentials matched, otherwise null
-
validate
Description copied from interface:LoginService
Validate a user identity. Validate that a UserIdentity previously created by a call toLoginService.login(String, Object, ServletRequest)
is still valid.- Specified by:
validate
in interfaceLoginService
- Parameters:
user
- The user to validate- Returns:
- true if authentication has not been revoked for the user.
-
getIdentityService
Description copied from interface:LoginService
Get the IdentityService associated with this Login Service.- Specified by:
getIdentityService
in interfaceLoginService
- Returns:
- the IdentityService associated with this Login Service.
-
logout
- Specified by:
logout
in interfaceLoginService
-
isFullValidate
public boolean isFullValidate() -
setFullValidate
public void setFullValidate(boolean fullValidate)
-