java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.jaas.JAASLoginService
- All Implemented Interfaces:
org.eclipse.jetty.security.LoginService,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
public class JAASLoginService
extends org.eclipse.jetty.util.component.ContainerLifeCycle
implements org.eclipse.jetty.security.LoginService
JAASLoginService
Implementation of jetty's LoginService that works with JAAS for
authorization and authentication.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Configurationprotected JAASUserPrincipalprotected org.eclipse.jetty.security.IdentityServiceprotected Stringprotected Stringprotected String[]static final Stringstatic final String[]static final ThreadLocal<JAASLoginService>Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected String[]Get all of the groups for the user.org.eclipse.jetty.security.IdentityServiceGet the identityService.getName()Get the name of the realm.String[]org.eclipse.jetty.server.UserIdentityvoidlogout(org.eclipse.jetty.server.UserIdentity user) voidsetCallbackHandlerClass(String classname) voidsetConfiguration(Configuration configuration) voidsetIdentityService(org.eclipse.jetty.security.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(org.eclipse.jetty.server.UserIdentity user) Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, 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.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Field Details
-
DEFAULT_ROLE_CLASS_NAME
- See Also:
-
DEFAULT_ROLE_CLASS_NAMES
-
INSTANCE
-
_roleClassNames
-
_callbackHandlerClass
-
_realmName
-
_loginModuleName
-
_defaultUser
-
_identityService
protected org.eclipse.jetty.security.IdentityService _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 interfaceorg.eclipse.jetty.security.LoginService- Returns:
- name or null if not set.
-
setName
Set the name of the realm- Parameters:
name- aStringvalue
-
getConfiguration
- Returns:
- the configuration
-
setConfiguration
- Parameters:
configuration- the configuration to set
-
getIdentityService
public org.eclipse.jetty.security.IdentityService getIdentityService()Get the identityService.- Specified by:
getIdentityServicein interfaceorg.eclipse.jetty.security.LoginService- Returns:
- the identityService
-
setIdentityService
public void setIdentityService(org.eclipse.jetty.security.IdentityService identityService) Set the identityService.- Specified by:
setIdentityServicein interfaceorg.eclipse.jetty.security.LoginService- 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
- Overrides:
doStartin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
Exception
-
login
public org.eclipse.jetty.server.UserIdentity login(String username, Object credentials, jakarta.servlet.ServletRequest request) - Specified by:
loginin interfaceorg.eclipse.jetty.security.LoginService
-
validate
public boolean validate(org.eclipse.jetty.server.UserIdentity user) - Specified by:
validatein interfaceorg.eclipse.jetty.security.LoginService
-
logout
public void logout(org.eclipse.jetty.server.UserIdentity user) - Specified by:
logoutin interfaceorg.eclipse.jetty.security.LoginService
-
getGroups
Get 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
-