public class JaasAuthenticator extends AbstractAuthenticator
<authenticator url="jaas:">
<init login-module="example.MyLogin"/>
</authenticator>
_passwordDigest, _passwordDigestAlgorithm, _passwordDigestRealm, NULL_USER
Constructor and Description |
---|
JaasAuthenticator() |
Modifier and Type | Method and Description |
---|---|
protected java.security.Principal |
authenticate(java.security.Principal principal,
PasswordCredentials cred,
java.lang.Object details)
Authenticate (login) the user.
|
void |
init()
Initialize the authenticator.
|
boolean |
isUserInRole(java.security.Principal principal,
java.lang.String role)
Returns true if the user plays the named role.
|
void |
setInitParam(InitParam init) |
void |
setLoginModule(java.lang.Class<?> loginModuleClass)
Sets the JAAS spi login module class.
|
void |
setOptions(InitParam init) |
addRoleMapping, authenticate, authenticate, authenticate, authenticate, digest, getAlgorithm, getDigest, getDigestSecret, getDigestSecret, getLogoutOnSessionTimeout, getPasswordDigest, getPasswordDigest, getPasswordDigestAlgorithm, getPasswordDigestRealm, getPasswordUser, getPasswordUser, getSingleSignon, logout, setLogoutOnSessionTimeout, setPasswordDigest, setPasswordDigestAlgorithm, setPasswordDigestRealm, setSerializationHandle, stringToDigest, toString, writeReplace
public void setLoginModule(java.lang.Class<?> loginModuleClass) throws ConfigException
ConfigException
public void setInitParam(InitParam init)
public void setOptions(InitParam init)
@PostConstruct public void init() throws ServletException
init
in class AbstractAuthenticator
ServletException
protected java.security.Principal authenticate(java.security.Principal principal, PasswordCredentials cred, java.lang.Object details)
authenticate
in class AbstractAuthenticator
public boolean isUserInRole(java.security.Principal principal, java.lang.String role)
isUserInRole
in interface Authenticator
isUserInRole
in class AbstractAuthenticator
request
- the servlet requestuser
- the user to testrole
- the role to test