Package org.eclipse.jetty.jaas
Class JAASLoginService
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.jaas.JAASLoginService
- All Implemented Interfaces:
- LoginService,- Container,- Destroyable,- Dumpable,- Dumpable.DumpableContainer,- LifeCycle
JAASLoginService
 Implementation of jetty's LoginService that works with JAAS for
 authorization and authentication.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.ContainerContainer.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.DumpableDumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycleLifeCycle.Listener
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Stringprotected Configurationprotected JAASUserPrincipalprotected IdentityServiceprotected Stringprotected Stringprotected String[]static final Stringstatic final String[]static final ThreadLocal<JAASLoginService>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.protected String[]Get all of the groups for the user.Get the identityService.getName()Get the name of the realm.String[]Login a user.voidlogout(UserIdentity user) voidsetCallbackHandlerClass(String classname) voidsetConfiguration(Configuration configuration) 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 org.eclipse.jetty.util.component.ContainerLifeCycleaddBean, addBean, addEventListener, addManaged, contains, destroy, 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCyclegetEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.ContainergetCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainerisDumpable
- 
Field Details- 
DEFAULT_ROLE_CLASS_NAME- See Also:
 
- 
DEFAULT_ROLE_CLASS_NAMES
- 
INSTANCE
- 
_roleClassNames
- 
_callbackHandlerClass
- 
_realmName
- 
_loginModuleName
- 
_defaultUser
- 
_identityService
- 
_configuration
 
- 
- 
Constructor Details- 
JAASLoginServicepublic JAASLoginService()
- 
JAASLoginService- Parameters:
- name- the name of the realm
 
 
- 
- 
Method Details- 
getNameGet the name of the realm.- Specified by:
- getNamein interface- LoginService
- Returns:
- name or null if not set.
 
- 
setNameSet the name of the realm- Parameters:
- name- a- Stringvalue
 
- 
getConfiguration- Returns:
- the configuration
 
- 
setConfiguration- Parameters:
- configuration- the configuration to set
 
- 
getIdentityServiceGet the identityService.- Specified by:
- getIdentityServicein interface- LoginService
- Returns:
- the identityService
 
- 
setIdentityServiceSet the identityService.- Specified by:
- setIdentityServicein interface- LoginService
- Parameters:
- identityService- the identityService to set
 
- 
setLoginModuleNameSet the name to use to index into the config file of LoginModules.- Parameters:
- name- a- Stringvalue
 
- 
setCallbackHandlerClass
- 
setRoleClassNames
- 
getRoleClassNames
- 
doStartDescription copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
- doStartin class- ContainerLifeCycle
- Throws:
- AbstractLifeCycle.StopException- If thrown, the lifecycle will immediately be stopped.
- Exception- If there was a problem starting. Will cause a transition to FAILED state
 
- 
loginpublic UserIdentity login(String username, Object credentials, javax.servlet.ServletRequest request) Description copied from interface:LoginServiceLogin a user.- Specified by:
- loginin interface- LoginService
- Parameters:
- username- The user name
- credentials- The users credentials
- request- TODO
- Returns:
- A UserIdentity if the credentials matched, otherwise null
 
- 
validateDescription copied from interface:LoginServiceValidate a user identity. Validate that a UserIdentity previously created by a call toLoginService.login(String, Object, ServletRequest)is still valid.- Specified by:
- validatein interface- LoginService
- Parameters:
- user- The user to validate
- Returns:
- true if authentication has not been revoked for the user.
 
- 
logout- Specified by:
- logoutin interface- LoginService
 
- 
getGroupsGet all of the groups for the user.- Parameters:
- subject- the Subject representing the user
- Returns:
- all the names of groups that the user is in, or 0 length array if none
 
 
-