public class UseridAttributeLdapContextMapper
extends org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
daoAuthenticationProvider
<property name="userDetailsContextMapper"> <ref local="ldapContextMapper" /> </property>
daoAuthenticationProvider
bean, create the
ldapContextMapper
bean as shown - make sure you update the property name to match your environment.
The default is samAccountName
<bean id="ldapContextMapper" class="org.pentaho.platform.engine.security.UseridAttributeLdapContextMapper"> <property name="ldapUsernameAttribute" value="samAccountName" /> </bean>
Constructor and Description |
---|
UseridAttributeLdapContextMapper() |
Modifier and Type | Method and Description |
---|---|
String |
getLdapUsernameAttribute() |
org.springframework.security.core.userdetails.UserDetails |
mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx,
String username,
Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) |
void |
setLdapUsernameAttribute(String value)
Sets the name of the LDAP attribute to use for the login name after authentication.
|
public org.springframework.security.core.userdetails.UserDetails mapUserFromContext(org.springframework.ldap.core.DirContextOperations ctx, String username, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
mapUserFromContext
in interface org.springframework.security.ldap.userdetails.UserDetailsContextMapper
mapUserFromContext
in class org.springframework.security.ldap.userdetails.LdapUserDetailsMapper
public void setLdapUsernameAttribute(String value)
Example - cn
Default value: samAccountName
Set the value as a bean property in the applicationContext-spring-security-ldap.xml
value
- public String getLdapUsernameAttribute()
Copyright © 2017 Hitachi Vantara. All rights reserved.