|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.security.ldap.DefaultInitialDirContextFactory
DefaultSpringSecurityContextSource
instead.
public class DefaultInitialDirContextFactory
Encapsulates the information for connecting to an LDAP server and provides an access point for obtaining DirContext references.
The directory location is configured using by setting the constructor argument providerUrl. This should be in the form ldap://monkeymachine.co.uk:389/dc=springframework,dc=org. The Sun JNDI provider also supports lists of space-separated URLs, each of which will be tried in turn until a connection is obtained.
To obtain an initial context, the client calls the newInitialDirContext method. There are two signatures - one with no arguments and one which allows binding with a specific username and password.
The no-args version will bind anonymously unless a manager login has been configured using the properties managerDn and managerPassword, in which case it will bind as the manager user.
Connection pooling is enabled by default for anonymous or manager connections, but not when binding as a specific user.
Field Summary | |
---|---|
protected MessageSourceAccessor |
messages
Deprecated. |
Constructor Summary | |
---|---|
DefaultInitialDirContextFactory(String providerUrl)
Deprecated. Create and initialize an instance to the LDAP url provided |
Method Summary | |
---|---|
org.springframework.ldap.core.DistinguishedName |
getBaseLdapPath()
Deprecated. |
String |
getBaseLdapPathAsString()
Deprecated. |
protected Hashtable |
getEnvironment()
Deprecated. Sets up the environment parameters for creating a new context. |
DirContext |
getReadOnlyContext()
Deprecated. Spring LDAP ContextSource method |
DirContext |
getReadWriteContext()
Deprecated. Spring LDAP ContextSource method |
DirContext |
getReadWriteContext(String userDn,
Object credentials)
Deprecated. Obtains a context using the supplied distinguished name and credentials. |
String |
getRootDn()
Deprecated. Returns the root DN of the configured provider URL. |
DirContext |
newInitialDirContext()
Deprecated. Connects anonymously unless a manager user has been specified, in which case it will bind as the manager. |
DirContext |
newInitialDirContext(String username,
String password)
Deprecated. Provides an initial context by binding as a specific user. |
void |
setAuthenticationType(String authenticationType)
Deprecated. |
void |
setDirObjectFactory(String dirObjectFactory)
Deprecated. |
void |
setExtraEnvVars(Map extraEnvVars)
Deprecated. Sets any custom environment variables which will be added to the those returned by the getEnvironment method. |
void |
setInitialContextFactory(String initialContextFactory)
Deprecated. |
void |
setManagerDn(String managerDn)
Deprecated. Sets the directory user to authenticate as when obtaining a context using the newInitialDirContext() method. |
void |
setManagerPassword(String managerPassword)
Deprecated. Sets the password which will be used in combination with the manager DN. |
void |
setMessageSource(MessageSource messageSource)
Deprecated. |
void |
setUseConnectionPool(boolean useConnectionPool)
Deprecated. Connection pooling is enabled by default for anonymous or "manager" connections when using the default Sun provider. |
void |
setUseLdapContext(boolean useLdapContext)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MessageSourceAccessor messages
Constructor Detail |
---|
public DefaultInitialDirContextFactory(String providerUrl)
providerUrl
- a String of the form ldap://localhost:389/base_dn
Method Detail |
---|
protected Hashtable getEnvironment()
public String getRootDn()
getRootDn
in interface InitialDirContextFactory
public DirContext newInitialDirContext()
newInitialDirContext
in interface InitialDirContextFactory
public DirContext newInitialDirContext(String username, String password)
InitialDirContextFactory
newInitialDirContext
in interface InitialDirContextFactory
username
- the user to authenticate as when obtaining the context.password
- the user's password.
public DirContext getReadOnlyContext() throws DataAccessException
getReadOnlyContext
in interface org.springframework.ldap.core.ContextSource
DataAccessException
public DirContext getReadWriteContext() throws DataAccessException
getReadWriteContext
in interface org.springframework.ldap.core.ContextSource
DataAccessException
public void setAuthenticationType(String authenticationType)
public void setExtraEnvVars(Map extraEnvVars)
extraEnvVars
- extra environment variables to be added at config time.public void setInitialContextFactory(String initialContextFactory)
public void setManagerDn(String managerDn)
managerDn
- The name of the "manager" user for default authentication.public void setManagerPassword(String managerPassword)
managerPassword
- The "manager" user's password.public void setMessageSource(MessageSource messageSource)
setMessageSource
in interface MessageSourceAware
public void setUseConnectionPool(boolean useConnectionPool)
useConnectionPool
- whether to pool connections for non-specific users.public void setUseLdapContext(boolean useLdapContext)
public void setDirObjectFactory(String dirObjectFactory)
public DirContext getReadWriteContext(String userDn, Object credentials)
SpringSecurityContextSource
getReadWriteContext
in interface SpringSecurityContextSource
userDn
- the distinguished name of the user to authenticate ascredentials
- the user's password
public org.springframework.ldap.core.DistinguishedName getBaseLdapPath()
getBaseLdapPath
in interface org.springframework.ldap.core.support.BaseLdapPathSource
public String getBaseLdapPathAsString()
getBaseLdapPathAsString
in interface org.springframework.ldap.core.support.BaseLdapPathSource
|
Spring Security Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |