public class JaasAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler
Using the JAAS Authentication Handler requires you to configure the appropriate JAAS modules. You can specify the location of a jass.conf file using the following VM parameter:
-Djava.security.auth.login.config=$PATH_TO_JAAS_CONF/jaas.conf
This example jaas.conf would try Kerberos based authentication, then try LDAP authentication:
CAS {
com.sun.security.auth.module.Krb5LoginModule sufficient
client=TRUE
debug=FALSE
useTicketCache=FALSE;
edu.uconn.netid.jaas.LDAPLoginModule sufficient
java.naming.provider.url="ldap://ldapserver.my.edu:389/dc=my,dc=edu"
java.naming.security.principal="uid=jaasauth,dc=my,dc=edu"
java.naming.security.credentials="password"
Attribute="uid"
startTLS="true";
};
CallbackHandler,
PasswordCallback,
NameCallback| Modifier and Type | Class and Description |
|---|---|
protected static class |
JaasAuthenticationHandler.UsernamePasswordCallbackHandler
A simple JAAS CallbackHandler which accepts a Name String and Password
String in the constructor.
|
logger| Constructor and Description |
|---|
JaasAuthenticationHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected HandlerResult |
authenticateUsernamePasswordInternal(UsernamePasswordCredential credential)
Authenticates a username/password credential by an arbitrary strategy.
|
void |
setRealm(String realm) |
createHandlerResult, doAuthentication, getPasswordEncoder, getPasswordPolicyConfiguration, getPrincipalNameTransformer, setPasswordEncoder, setPasswordPolicyConfiguration, setPrincipalNameTransformer, supportsauthenticate, postAuthenticate, preAuthenticategetName, setNameprotected final HandlerResult authenticateUsernamePasswordInternal(UsernamePasswordCredential credential) throws GeneralSecurityException, PreventedException
authenticateUsernamePasswordInternal in class AbstractUsernamePasswordAuthenticationHandlercredential - the credential object bearing the transformed username and password.GeneralSecurityException - On authentication failure.PreventedException - On the indeterminate case when authentication is prevented.public void setRealm(String realm)
Copyright © 2004-2015 Apereo. All Rights Reserved.