Class PasswordPolicyAwareContextSource
- java.lang.Object
-
- org.springframework.ldap.core.support.AbstractContextSource
-
- org.springframework.ldap.core.support.LdapContextSource
-
- org.springframework.security.ldap.DefaultSpringSecurityContextSource
-
- org.springframework.security.ldap.ppolicy.PasswordPolicyAwareContextSource
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.ldap.core.ContextSource
,org.springframework.ldap.core.support.BaseLdapPathContextSource
,org.springframework.ldap.core.support.BaseLdapPathSource
public class PasswordPolicyAwareContextSource extends DefaultSpringSecurityContextSource
Extended version of the DefaultSpringSecurityContextSource which adds support for the use ofPasswordPolicyControl
to make use of user account data stored in the directory.When binding with specific username (not the userDn) property it will connect first as the userDn, then reconnect as the user in order to retrieve any password-policy control sent with the response, even if an exception occurs.
- Since:
- 3.0
-
-
Field Summary
-
Fields inherited from class org.springframework.security.ldap.DefaultSpringSecurityContextSource
logger
-
-
Constructor Summary
Constructors Constructor Description PasswordPolicyAwareContextSource(java.lang.String providerUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Hashtable
getAuthenticatedEnv(java.lang.String principal, java.lang.String credentials)
javax.naming.directory.DirContext
getContext(java.lang.String principal, java.lang.String credentials)
-
Methods inherited from class org.springframework.ldap.core.support.LdapContextSource
getDirContextInstance
-
Methods inherited from class org.springframework.ldap.core.support.AbstractContextSource
afterPropertiesSet, assembleProviderUrlString, createContext, getAnonymousEnv, getAuthenticationSource, getBaseLdapName, getBaseLdapPath, getBaseLdapPathAsString, getContextFactory, getDirObjectFactory, getPassword, getReadOnlyContext, getReadWriteContext, getUrls, getUserDn, isAnonymousReadOnly, isPooled, setAnonymousReadOnly, setAuthenticationSource, setAuthenticationStrategy, setBase, setBaseEnvironmentProperties, setCacheEnvironmentProperties, setContextFactory, setDirObjectFactory, setPassword, setPooled, setReferral, setupAuthenticatedEnvironment, setUrl, setUrls, setUserDn
-
-
-
-
Method Detail
-
getContext
public javax.naming.directory.DirContext getContext(java.lang.String principal, java.lang.String credentials) throws PasswordPolicyException
- Specified by:
getContext
in interfaceorg.springframework.ldap.core.ContextSource
- Overrides:
getContext
in classorg.springframework.ldap.core.support.AbstractContextSource
- Throws:
PasswordPolicyException
-
getAuthenticatedEnv
protected java.util.Hashtable getAuthenticatedEnv(java.lang.String principal, java.lang.String credentials)
- Overrides:
getAuthenticatedEnv
in classorg.springframework.ldap.core.support.AbstractContextSource
-
-