|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.realm.ldap.DefaultLdapContextFactory
JndiLdapContextFactory
implementation. This implementation will be removed
prior to Shiro 2.0
@Deprecated public class DefaultLdapContextFactory
Default implementation of LdapContextFactory
that can be configured or extended to
customize the way LdapContext
objects are retrieved.
This implementation of LdapContextFactory
is used by the AbstractLdapRealm
if a
factory is not explictly configured.
Connection pooling is enabled by default on this factory, but can be disabled using the
usePooling
property.
Field Summary | |
---|---|
protected String |
authentication
Deprecated. |
protected String |
contextFactoryClassName
Deprecated. |
protected String |
principalSuffix
Deprecated. |
protected String |
referral
Deprecated. |
protected String |
searchBase
Deprecated. |
protected static String |
SUN_CONNECTION_POOLING_PROPERTY
Deprecated. The Sun LDAP property used to enable connection pooling. |
protected String |
systemPassword
Deprecated. |
protected String |
systemUsername
Deprecated. |
protected String |
url
Deprecated. |
Constructor Summary | |
---|---|
DefaultLdapContextFactory()
Deprecated. |
Method Summary | |
---|---|
LdapContext |
getLdapContext(Object principal,
Object credentials)
Deprecated. 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. Shiro no longer calls this method - it will be
removed before the 2.0 release. |
LdapContext |
getSystemLdapContext()
Deprecated. Creates (or retrieves from a pool) a LdapContext connection bound using the system account, or
anonymously if no system account is configured. |
void |
setAdditionalEnvironment(Map<String,String> additionalEnvironment)
Deprecated. These entries are added to the environment map before initializing the LDAP context. |
void |
setAuthentication(String authentication)
Deprecated. Sets the type of LDAP authentication to perform when connecting to the LDAP server. |
void |
setContextFactoryClassName(String contextFactoryClassName)
Deprecated. The context factory to use. |
void |
setPrincipalSuffix(String principalSuffix)
Deprecated. A suffix appended to the username. |
void |
setReferral(String referral)
Deprecated. Sets the LDAP referral property. |
void |
setSearchBase(String searchBase)
Deprecated. this attribute existed, but was never used in Shiro 1.x. It will be removed prior to Shiro 2.0. |
void |
setSystemPassword(String systemPassword)
Deprecated. The system password that will be used when connecting to the LDAP server to retrieve authorization information about a user. |
void |
setSystemUsername(String systemUsername)
Deprecated. The system username that will be used when connecting to the LDAP server to retrieve authorization information about a user. |
void |
setUrl(String url)
Deprecated. The LDAP url to connect to. |
void |
setUsePooling(boolean usePooling)
Deprecated. Determines whether or not LdapContext pooling is enabled for connections made using the system user account. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String SUN_CONNECTION_POOLING_PROPERTY
protected String authentication
protected String principalSuffix
protected String searchBase
protected String contextFactoryClassName
protected String url
protected String referral
protected String systemUsername
protected String systemPassword
Constructor Detail |
---|
public DefaultLdapContextFactory()
Method Detail |
---|
public void setAuthentication(String authentication)
authentication
- the type of LDAP authentication to perform.public void setPrincipalSuffix(String principalSuffix)
principalSuffix
- the suffix.@Deprecated public void setSearchBase(String searchBase)
searchBase
- the search base.public void setContextFactoryClassName(String contextFactoryClassName)
contextFactoryClassName
- the context factory that should be used.public void setUrl(String url)
url
- the LDAP url.public void setReferral(String referral)
referral
- the referral property.public void setSystemUsername(String systemUsername)
systemUsername
- the username to use when logging into the LDAP server for authorization.public void setSystemPassword(String systemPassword)
systemPassword
- the password to use when logging into the LDAP server for authorization.public void setUsePooling(boolean usePooling)
usePooling
- true to enable pooling, or false to disable it.public void setAdditionalEnvironment(Map<String,String> additionalEnvironment)
additionalEnvironment
- additional environment entries to be configured on the LDAP context.public LdapContext getSystemLdapContext() throws NamingException
LdapContextFactory
LdapContext
connection bound using the system account, or
anonymously if no system account is configured.
getSystemLdapContext
in interface LdapContextFactory
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 public 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. Shiro no longer calls this method - it will be
removed before the 2.0 release.
getLdapContext(Object, Object)
instead. This will be removed before Apache Shiro 2.0.
getLdapContext
in interface LdapContextFactory
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.public LdapContext getLdapContext(Object principal, Object credentials) throws NamingException
LdapContextFactory
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.
getLdapContext
in interface LdapContextFactory
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 directory
LdapContext
connection bound using the specified principal and credentials.
NamingException
- if unable to acquire a connection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |