public final class Hotfix3960ActiveDirectoryLdapAuthenticationProvider
extends org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider
| Constructor and Description |
|---|
Hotfix3960ActiveDirectoryLdapAuthenticationProvider(String domain,
String url) |
Hotfix3960ActiveDirectoryLdapAuthenticationProvider(String domain,
String url,
String rootDn) |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.ldap.core.DirContextOperations |
doAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken auth) |
protected Collection<? extends org.springframework.security.core.GrantedAuthority> |
loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData,
String username,
String password)
Creates the user authority list from the values of the
memberOf attribute
obtained from the user's Active Directory entry. |
void |
setConvertSubErrorCodesToExceptions(boolean convertSubErrorCodesToExceptions)
By default, a failed authentication (LDAP error 49) will result in a
BadCredentialsException. |
void |
setSearchFilter(String searchFilter)
The LDAP filter string to search for the user being authenticated.
|
authenticate, createSuccessfulAuthentication, getUserDetailsContextMapper, setAuthoritiesMapper, setMessageSource, setUseAuthenticationRequestCredentials, setUserDetailsContextMapper, supportspublic Hotfix3960ActiveDirectoryLdapAuthenticationProvider(String domain, String url, String rootDn)
domain - the domain name (may be null or empty)url - an LDAP url (or multiple URLs)rootDn - the root DN (may be null or empty)protected org.springframework.ldap.core.DirContextOperations doAuthentication(org.springframework.security.authentication.UsernamePasswordAuthenticationToken auth)
doAuthentication in class org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProviderprotected Collection<? extends org.springframework.security.core.GrantedAuthority> loadUserAuthorities(org.springframework.ldap.core.DirContextOperations userData, String username, String password)
memberOf attribute
obtained from the user's Active Directory entry.loadUserAuthorities in class org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProviderpublic void setConvertSubErrorCodesToExceptions(boolean convertSubErrorCodesToExceptions)
BadCredentialsException.
If this property is set to true, the exception message from a failed bind
attempt will be parsed for the AD-specific error code and a
CredentialsExpiredException, DisabledException,
AccountExpiredException or LockedException will be thrown for the
corresponding codes. All other codes will result in the default
BadCredentialsException.
convertSubErrorCodesToExceptions - true to raise an exception based on
the AD error code.public void setSearchFilter(String searchFilter)
username@domain.
Defaults to: (&(objectClass=user)(userPrincipalName= 0))}
searchFilter - the filter stringCopyright © 2019. All rights reserved.