public class LDAPUserDataProvider extends Object implements UserDataProvider
The LDAP User Data Provider performs two jobs:
To achieve this, it first binds to base on the LDAP server url. If binddn is not present, it binds to the LDAP server anonymously, elsewise binddn and bindpw are used for authentication.
Next, a search searchPattern with scope searchScope is executed where "%LOGIN%" is replaced by the escaped version of the username.
The search returning no node or more than one node is treated as failure.
If passwordAttribute is set, and the node has an attribute with this name and this attribute's value starts with "{x-plain}", the password is checked against the rest of the value for equality. If passwordAttribute is not set, a second binding is attempted on the node using the password the user provided.
The user attribute keys specified in the mapping are then renamed according to the mapping and used for further processing (see the other modules of the login interceptor).
For the initial binding, connectTimeout can be used to specify a timeout in milliseconds. For the search, timeout can be used.
If readAttributesAsSelf is not set, the user attributes are collected from the search result. If it is set, an additional request is made after the second successful binding to retrieve the node's attributes.
| Modifier and Type | Class and Description |
|---|---|
static class |
LDAPUserDataProvider.AttributeMap |
static class |
LDAPUserDataProvider.CustomSocketFactory |
static class |
LDAPUserDataProvider.SearchScope |
| Constructor and Description |
|---|
LDAPUserDataProvider() |
public Map<String,String> verify(Map<String,String> postData)
verify in interface UserDataProviderpublic String getUrl()
public void setUrl(String url)
public String getBase()
public void setBase(String base)
public String getBinddn()
public void setBinddn(String binddn)
public String getBindpw()
public void setBindpw(String bindpw)
public String getSearchPattern()
public void setSearchPattern(String searchPattern)
public LDAPUserDataProvider.SearchScope getSearchScope()
public void setSearchScope(LDAPUserDataProvider.SearchScope searchScope)
public String getPasswordAttribute()
public void setPasswordAttribute(String passwordAttribute)
public String getTimeout()
public void setTimeout(String timeout)
public String getConnectTimeout()
public void setConnectTimeout(String connectTimeout)
public boolean isReadAttributesAsSelf()
public void setReadAttributesAsSelf(boolean readAttributesAsSelf)
public SSLParser getSslParser()
public void setSslParser(SSLParser sslParser)
public void init(Router router)
init in interface UserDataProviderpublic LDAPUserDataProvider.AttributeMap getMap()
public void setMap(LDAPUserDataProvider.AttributeMap map)
Copyright © 2021. All Rights Reserved.