public class JAASLoginService extends ContainerLifeCycle implements LoginService
AbstractLifeCycle.AbstractLifeCycleListenerContainer.InheritedListener, Container.ListenerDumpable.DumpableContainerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_callbackHandlerClass |
protected javax.security.auth.login.Configuration |
_configuration |
protected JAASUserPrincipal |
_defaultUser |
protected IdentityService |
_identityService |
protected java.lang.String |
_loginModuleName |
protected java.lang.String |
_realmName |
protected java.lang.String[] |
_roleClassNames |
static java.lang.String |
DEFAULT_ROLE_CLASS_NAME |
static java.lang.String[] |
DEFAULT_ROLE_CLASS_NAMES |
static java.lang.ThreadLocal<JAASLoginService> |
INSTANCE |
| Constructor and Description |
|---|
JAASLoginService() |
JAASLoginService(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart()
Starts the managed lifecycle beans in the order they were added.
|
javax.security.auth.login.Configuration |
getConfiguration() |
protected java.lang.String[] |
getGroups(javax.security.auth.Subject subject)
Get all of the groups for the user.
|
IdentityService |
getIdentityService()
Get the identityService.
|
java.lang.String |
getName()
Get the name of the realm.
|
java.lang.String[] |
getRoleClassNames() |
UserIdentity |
login(java.lang.String username,
java.lang.Object credentials,
javax.servlet.ServletRequest request)
Login a user.
|
void |
logout(UserIdentity user) |
void |
setCallbackHandlerClass(java.lang.String classname) |
void |
setConfiguration(javax.security.auth.login.Configuration configuration) |
void |
setIdentityService(IdentityService identityService)
Set the identityService.
|
void |
setLoginModuleName(java.lang.String name)
Set the name to use to index into the config
file of LoginModules.
|
void |
setName(java.lang.String name)
Set the name of the realm
|
void |
setRoleClassNames(java.lang.String[] classnames) |
boolean |
validate(UserIdentity user)
Validate a user identity.
|
addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisDumpabledumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic static final java.lang.String DEFAULT_ROLE_CLASS_NAME
public static final java.lang.String[] DEFAULT_ROLE_CLASS_NAMES
public static final java.lang.ThreadLocal<JAASLoginService> INSTANCE
protected java.lang.String[] _roleClassNames
protected java.lang.String _callbackHandlerClass
protected java.lang.String _realmName
protected java.lang.String _loginModuleName
protected JAASUserPrincipal _defaultUser
protected IdentityService _identityService
protected javax.security.auth.login.Configuration _configuration
public JAASLoginService()
public JAASLoginService(java.lang.String name)
name - the name of the realmpublic java.lang.String getName()
getName in interface LoginServicepublic void setName(java.lang.String name)
name - a String valuepublic javax.security.auth.login.Configuration getConfiguration()
public void setConfiguration(javax.security.auth.login.Configuration configuration)
configuration - the configuration to setpublic IdentityService getIdentityService()
getIdentityService in interface LoginServicepublic void setIdentityService(IdentityService identityService)
setIdentityService in interface LoginServiceidentityService - the identityService to setpublic void setLoginModuleName(java.lang.String name)
name - a String valuepublic void setCallbackHandlerClass(java.lang.String classname)
public void setRoleClassNames(java.lang.String[] classnames)
public java.lang.String[] getRoleClassNames()
protected void doStart()
throws java.lang.Exception
ContainerLifeCycledoStart in class ContainerLifeCyclejava.lang.Exceptionpublic UserIdentity login(java.lang.String username, java.lang.Object credentials, javax.servlet.ServletRequest request)
LoginServicelogin in interface LoginServiceusername - The user namecredentials - The users credentialsrequest - TODOpublic boolean validate(UserIdentity user)
LoginServiceLoginService.login(String, Object, ServletRequest) is still valid.validate in interface LoginServiceuser - The user to validatepublic void logout(UserIdentity user)
logout in interface LoginServiceprotected java.lang.String[] getGroups(javax.security.auth.Subject subject)
subject - the Subject representing the userCopyright © 1995–2021 Webtide. All rights reserved.