public interface ContextSource
ContextSourceis responsible for configuring and creating
DirContextinstances. It is typically used from
LdapTemplateto acquiring contexts for LDAP operations, but may be used standalone to perform LDAP authentication.
|Modifier and Type||Method and Description|
Gets a read-only
Gets a read-write
DirContext getReadOnlyContext() throws NamingException
DirContext. The returned
DirContextmust be possible to perform read-only operations on.
NamingException- if some error occurs creating an DirContext.
DirContext getReadWriteContext() throws NamingException
NamingException- if some error occurs creating an
DirContext getContext(String principal, String credentials) throws NamingException
DirContextinstance authenticated using the supplied principal and credentials. Typically to be used for plain authentication purposes. Note that this method will never make use of native Java LDAP pooling, even though this instance is configured to do so. This is to force password changes in the target directory to take effect as soon as possible.
principal- The principal (typically a distinguished name of a user in the LDAP tree) to use for authentication.
credentials- The credentials to use for authentication.