public class SearchDnResolver extends AbstractLdap<AuthenticatorConfig> implements DnResolver, Serializable
SearchDnResolver
looks up a user's DN using an LDAP search.BINDING_COPY_RESULT_HANDLER, config, connectionHandler, COPY_RESULT_HANDLER, logger, NCP_COPY_RESULT_HANDLER, SR_COPY_RESULT_HANDLER
Constructor and Description |
---|
SearchDnResolver()
Default constructor.
|
SearchDnResolver(AuthenticatorConfig authConfig)
This will create a new
SearchDnResolver with the supplied
AuthenticatorConfig . |
Modifier and Type | Method and Description |
---|---|
void |
close()
This will close the connection to the LDAP.
|
AuthenticatorConfig |
getAuthenticatorConfig()
This returns the
AuthenticatorConfig of the
Authenticator . |
String |
resolve(String user)
This will attempt to find the dn for the supplied user.
|
void |
setAuthenticatorConfig(AuthenticatorConfig authConfig)
This will set the config parameters of this
Authenticator . |
compare, connect, create, delete, finalize, getAttributes, getContext, getSchema, list, listBindings, modifyAttributes, modifyAttributes, operationRetry, pagedSearch, reconnect, rename, search, searchAttributes, setLdapConfig, toString
public SearchDnResolver()
public SearchDnResolver(AuthenticatorConfig authConfig)
SearchDnResolver
with the supplied
AuthenticatorConfig
.authConfig
- AuthenticatorConfig
public void setAuthenticatorConfig(AuthenticatorConfig authConfig)
Authenticator
.setAuthenticatorConfig
in interface DnResolver
authConfig
- AuthenticatorConfig
public AuthenticatorConfig getAuthenticatorConfig()
AuthenticatorConfig
of the
Authenticator
.getAuthenticatorConfig
in interface DnResolver
AuthenticatorConfig
public String resolve(String user) throws NamingException
AuthenticatorConfig.getUserFilter()
or AuthenticatorConfig.getUserField()
is used to look up the dn. If a filter
is used, the user is provided as the {0} variable filter argument. If a
field is used, the filter is built by ORing the fields together. If more
than one entry matches the search, the result is controlled by AuthenticatorConfig.setAllowMultipleDns(boolean)
.resolve
in interface DnResolver
user
- String
to find dn forString
- user's dnNamingException
- if the LDAP search failspublic void close()
close
in interface DnResolver
close
in interface BaseLdap
close
in class AbstractLdap<AuthenticatorConfig>
Copyright © 2019. All rights reserved.