public class LdapAuthenticationHandler
extends org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler
Authenticator component underneath.
This handler provides simple attribute resolution machinery by reading attributes from the entry
corresponding to the DN of the bound user (in the bound security context) upon successful authentication.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
principalAttributeMap
Mapping of LDAP attribute name to principal attribute name.
|
passwordPolicyHandlingStrategycredentialSelectionPredicate, principalFactory, servicesManager| Constructor and Description |
|---|
LdapAuthenticationHandler(java.lang.String name,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
java.lang.Integer order,
org.ldaptive.auth.Authenticator authenticator,
org.apereo.cas.authentication.AuthenticationPasswordPolicyHandlingStrategy strategy)
Creates a new authentication handler that delegates to the given authenticator.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult |
authenticateUsernamePasswordInternal(org.apereo.cas.authentication.UsernamePasswordCredential upc,
java.lang.String originalPassword) |
protected java.util.Map<java.lang.String,java.lang.Object> |
collectAttributesForLdapEntry(org.ldaptive.LdapEntry ldapEntry,
java.lang.String username)
Collect attributes for ldap entry.
|
protected org.apereo.cas.authentication.principal.Principal |
createPrincipal(java.lang.String username,
org.ldaptive.LdapEntry ldapEntry)
Creates a CAS principal with attributes if the LDAP entry contains principal attributes.
|
protected java.lang.String |
getLdapPrincipalIdentifier(java.lang.String username,
org.ldaptive.LdapEntry ldapEntry)
Gets ldap principal identifier.
|
void |
initialize()
Initialize the handler, setup the authentication entry attributes.
|
doAuthentication, getPasswordEncoder, getPasswordPolicyConfiguration, getPasswordPolicyHandlingStrategy, getPrincipalNameTransformer, matches, setPasswordEncoder, setPasswordPolicyConfiguration, setPasswordPolicyHandlingStrategy, setPrincipalNameTransformer, supportsauthenticate, createHandlerResult, createHandlerResultgetCredentialSelectionPredicate, getName, getOrder, getPrincipalFactory, getServicesManager, setCredentialSelectionPredicateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected java.util.Map<java.lang.String,java.lang.Object> principalAttributeMap
public LdapAuthenticationHandler(java.lang.String name,
org.apereo.cas.services.ServicesManager servicesManager,
org.apereo.cas.authentication.principal.PrincipalFactory principalFactory,
java.lang.Integer order,
org.ldaptive.auth.Authenticator authenticator,
org.apereo.cas.authentication.AuthenticationPasswordPolicyHandlingStrategy strategy)
name - the nameservicesManager - the services managerprincipalFactory - the principal factoryorder - the orderauthenticator - Ldaptive authenticator component.strategy - the strategyprotected org.apereo.cas.authentication.AuthenticationHandlerExecutionResult authenticateUsernamePasswordInternal(org.apereo.cas.authentication.UsernamePasswordCredential upc,
java.lang.String originalPassword)
throws java.security.GeneralSecurityException,
org.apereo.cas.authentication.PreventedException
authenticateUsernamePasswordInternal in class org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandlerjava.security.GeneralSecurityExceptionorg.apereo.cas.authentication.PreventedExceptionprotected org.apereo.cas.authentication.principal.Principal createPrincipal(java.lang.String username,
org.ldaptive.LdapEntry ldapEntry)
throws javax.security.auth.login.LoginException
username - Username that was successfully authenticated which is used for principal ID when principal id is not specified.ldapEntry - LDAP entry that may contain principal attributes.javax.security.auth.login.LoginException - On security policy errors related to principal creation.protected java.util.Map<java.lang.String,java.lang.Object> collectAttributesForLdapEntry(org.ldaptive.LdapEntry ldapEntry,
java.lang.String username)
ldapEntry - the ldap entryusername - the usernameprotected java.lang.String getLdapPrincipalIdentifier(java.lang.String username,
org.ldaptive.LdapEntry ldapEntry)
throws javax.security.auth.login.LoginException
username - the usernameldapEntry - the ldap entryjavax.security.auth.login.LoginException - in case the principal id cannot be determined.public void initialize()