Class JAASLoginService
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.security.jaas.JAASLoginService
- All Implemented Interfaces:
 LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
Implementation of jetty's LoginService that works with JAAS for
authorization and authentication.
- 
Nested Class Summary
Nested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer, Dumpable.DumpAppendableNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Configurationprotected JAASUserPrincipalprotected IdentityServiceprotected Stringprotected Stringprotected String[]static final Stringstatic final String[]static final ThreadLocal<JAASLoginService>  - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.Get the configuration.protected String[]Get all of the groups for the user.Get the identityService.getName()Get the name of the realm.String[]login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Login a user.voidlogout(UserIdentity user) voidsetCallbackHandlerClass(String classname) voidsetConfiguration(Configuration configuration) Set the configuration to set.voidsetIdentityService(IdentityService identityService) Set the identityService.voidsetLoginModuleName(String name) Set the name to use to index into the config file of LoginModules.voidSet the name of the realmvoidsetRoleClassNames(String[] classnames) booleanvalidate(UserIdentity user) Validate a user identity.Methods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface LoginService
getUserIdentity 
- 
Field Details
- 
DEFAULT_ROLE_CLASS_NAME
- See Also:
 
 - 
DEFAULT_ROLE_CLASS_NAMES
 - 
INSTANCE
 - 
_roleClassNames
 - 
_callbackHandlerClass
 - 
_realmName
 - 
_loginModuleName
 - 
_defaultUser
 - 
_identityService
 - 
_configuration
 
 - 
 - 
Constructor Details
- 
JAASLoginService
public JAASLoginService() - 
JAASLoginService
- Parameters:
 name- the name of the realm
 
 - 
 - 
Method Details
- 
getName
Get the name of the realm.- Specified by:
 getNamein interfaceLoginService- Returns:
 - name or null if not set.
 
 - 
setName
 - 
getConfiguration
 - 
setConfiguration
Set the configuration to set.- Parameters:
 configuration- the configuration to set
 - 
getIdentityService
Get the identityService.- Specified by:
 getIdentityServicein interfaceLoginService- Returns:
 - the identityService
 
 - 
setIdentityService
Set the identityService.- Specified by:
 setIdentityServicein interfaceLoginService- Parameters:
 identityService- the identityService to set
 - 
setLoginModuleName
Set the name to use to index into the config file of LoginModules.- Parameters:
 name- aStringvalue
 - 
setCallbackHandlerClass
 - 
setRoleClassNames
 - 
getRoleClassNames
 - 
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
 doStartin classContainerLifeCycle- Throws:
 Exception- If there was a problem starting. Will cause a transition to FAILED state
 - 
login
public UserIdentity login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Description copied from interface:LoginServiceLogin a user.- Specified by:
 loginin interfaceLoginService- Parameters:
 username- The username.credentials- The users credentials.request- The request or nullgetOrCreateSession- function to retrieve or create a session.- Returns:
 - A UserIdentity if the credentials matched, otherwise null
 
 - 
validate
Description copied from interface:LoginServiceValidate a user identity. Validate that a UserIdentity previously created by a call toLoginService.login(String, Object, Request, Function)is still valid.- Specified by:
 validatein interfaceLoginService- Parameters:
 user- The user to validate- Returns:
 - true if authentication has not been revoked for the user.
 
 - 
logout
- Specified by:
 logoutin interfaceLoginService
 - 
getGroups
 
 -