com.caucho.server.security
Class JaasAuthenticator
java.lang.Object
com.caucho.server.security.AbstractAuthenticator
com.caucho.server.security.JaasAuthenticator
- All Implemented Interfaces:
- ServletAuthenticator, HandleAware, java.io.Serializable
public class JaasAuthenticator
- extends AbstractAuthenticator
The JAAS authenticator uses an existing JAAS LoginModule. Applications
which have existing JAAS modules can use the JaasAuthenticator to
log users in based on the old login.
<authenticator url="jaas:">
<init login-module="example.MyLogin"/>
</authenticator>
- See Also:
- Serialized Form
| Methods inherited from class com.caucho.server.security.AbstractAuthenticator |
addRoleMapping, digest, getDigestPassword, getDigestSecret, getLogoutOnSessionTimeout, getPasswordDigest, getPasswordDigest, getPasswordDigestAlgorithm, getPasswordDigestRealm, getPrincipalCacheSize, getUserPrincipal, getUserPrincipalImpl, login, loginDigest, loginDigestImpl, logout, logout, logout, setLogoutOnSessionTimeout, setPasswordDigest, setPasswordDigestAlgorithm, setPasswordDigestRealm, setPrincipalCacheSize, setSerializationHandle, stringToDigest, toString, writeReplace |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JaasAuthenticator
public JaasAuthenticator()
setLoginModule
public void setLoginModule(java.lang.Class loginModuleClass)
throws ConfigException
- Sets the JAAS spi login module class.
- Throws:
ConfigException
setInitParam
public void setInitParam(InitParam init)
setOptions
public void setOptions(InitParam init)
init
public void init()
throws ServletException
- Initialize the authenticator.
- Specified by:
init in interface ServletAuthenticator- Overrides:
init in class AbstractAuthenticator
- Throws:
ServletException
loginImpl
protected java.security.Principal loginImpl(HttpServletRequest request,
HttpServletResponse response,
ServletContext application,
java.lang.String userName,
java.lang.String password)
throws ServletException
- Authenticate (login) the user.
- Overrides:
loginImpl in class AbstractAuthenticator
- Throws:
ServletException
isUserInRole
public boolean isUserInRole(HttpServletRequest request,
HttpServletResponse response,
ServletContext application,
java.security.Principal principal,
java.lang.String role)
throws ServletException
- Returns true if the user plays the named role.
- Specified by:
isUserInRole in interface ServletAuthenticator- Overrides:
isUserInRole in class AbstractAuthenticator
- Parameters:
request - the servlet requestuser - the user to testrole - the role to test
- Throws:
ServletException