public interface LdapContextFactory
LdapContext
objects that are used by DefaultLdapRealm
s to
perform authentication attempts and query for authorization data.Modifier and Type | Method and Description |
---|---|
LdapContext |
getLdapContext(Object principal,
Object credentials)
Creates (or retrieves from a pool) an
LdapContext connection bound using the specified principal and
credentials. |
LdapContext |
getLdapContext(String username,
String password)
Deprecated.
the
getLdapContext(Object, Object) method should be used in all cases to ensure more than
String principals and credentials can be used. |
LdapContext |
getSystemLdapContext()
Creates (or retrieves from a pool) a
LdapContext connection bound using the system account, or
anonymously if no system account is configured. |
LdapContext getSystemLdapContext() throws NamingException
LdapContext
connection bound using the system account, or
anonymously if no system account is configured.LdapContext
bound by the system account, or bound anonymously if no system account
is configured.NamingException
- if there is an error creating the context.@Deprecated LdapContext getLdapContext(String username, String password) throws NamingException
getLdapContext(Object, Object)
method should be used in all cases to ensure more than
String principals and credentials can be used.LdapContext
connection bound using the username and password
specified.username
- the username to use when creating the connection.password
- the password to use when creating the connection.LdapContext
bound using the given username and password.NamingException
- if there is an error creating the context.LdapContext getLdapContext(Object principal, Object credentials) throws NamingException
LdapContext
connection bound using the specified principal and
credentials. The format of the principal and credentials are whatever is supported by the underlying
LDAP InitialContextFactory
implementation. The default Sun
(now Oracle) implementation supports
anonymous, simple, and
SASL-based mechanisms.
This method was added in Shiro 1.1 to address the fact that principals and credentials can be more than just
String
user DNs and passwords for connecting to LDAP. For example, the credentials can be an
X.509
certificate.principal
- the principal to use when acquiring a connection to the LDAP directorycredentials
- the credentials (password, X.509 certificate, etc) to use when acquiring a connection to the
LDAP directoryLdapContext
connection bound using the specified principal and credentials.NamingException
- if unable to acquire a connection.Copyright © 2004–2016 The Apache Software Foundation. All rights reserved.