21 changed files with 658 additions and 82 deletions
@ -0,0 +1,103 @@
@@ -0,0 +1,103 @@
|
||||
package org.springframework.security.config; |
||||
|
||||
import org.springframework.security.ldap.populator.DefaultLdapAuthoritiesPopulator; |
||||
import org.springframework.security.ldap.SpringSecurityContextSource; |
||||
import org.springframework.security.providers.ldap.LdapAuthenticationProvider; |
||||
import org.springframework.security.providers.ldap.authenticator.BindAuthenticator; |
||||
import org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor; |
||||
import org.springframework.security.ui.rememberme.RememberMeServices; |
||||
import org.springframework.beans.factory.config.BeanDefinition; |
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor; |
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; |
||||
import org.springframework.beans.factory.config.RuntimeBeanReference; |
||||
import org.springframework.beans.factory.support.RootBeanDefinition; |
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry; |
||||
import org.springframework.beans.factory.xml.BeanDefinitionParser; |
||||
import org.springframework.beans.factory.xml.ParserContext; |
||||
import org.springframework.beans.BeansException; |
||||
import org.springframework.core.Ordered; |
||||
import org.springframework.ldap.core.ContextSource; |
||||
import org.springframework.util.StringUtils; |
||||
|
||||
import org.apache.commons.logging.Log; |
||||
import org.apache.commons.logging.LogFactory; |
||||
import org.w3c.dom.Element; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* Experimental "security:ldap" namespace configuration. |
||||
* |
||||
* |
||||
* @author Luke Taylor |
||||
* @version $Id$ |
||||
* @since 2.0 |
||||
*/ |
||||
public class LdapProviderBeanDefinitionParser implements BeanDefinitionParser { |
||||
private Log logger = LogFactory.getLog(getClass()); |
||||
|
||||
private static final String ATT_AUTH_TYPE = "auth-type"; |
||||
private static final String ATT_SERVER = "server-ref"; |
||||
|
||||
private static final String OPT_DEFAULT_DN_PATTERN = "uid={0},ou=people"; |
||||
private static final String DEFAULT_GROUP_CONTEXT = "ou=groups"; |
||||
|
||||
|
||||
public BeanDefinition parse(Element elt, ParserContext parserContext) { |
||||
String server = elt.getAttribute(ATT_SERVER); |
||||
|
||||
if (!StringUtils.hasText(server)) { |
||||
server = BeanIds.CONTEXT_SOURCE; |
||||
} |
||||
|
||||
RuntimeBeanReference contextSource = new RuntimeBeanReference(server); |
||||
|
||||
RootBeanDefinition bindAuthenticator = new RootBeanDefinition(BindAuthenticator.class); |
||||
bindAuthenticator.getConstructorArgumentValues().addGenericArgumentValue(contextSource); |
||||
bindAuthenticator.getPropertyValues().addPropertyValue("userDnPatterns", new String[] {OPT_DEFAULT_DN_PATTERN}); |
||||
RootBeanDefinition authoritiesPopulator = new RootBeanDefinition(DefaultLdapAuthoritiesPopulator.class); |
||||
authoritiesPopulator.getConstructorArgumentValues().addGenericArgumentValue(contextSource); |
||||
authoritiesPopulator.getConstructorArgumentValues().addGenericArgumentValue(DEFAULT_GROUP_CONTEXT); |
||||
|
||||
RootBeanDefinition ldapProvider = new RootBeanDefinition(LdapAuthenticationProvider.class); |
||||
ldapProvider.getConstructorArgumentValues().addGenericArgumentValue(bindAuthenticator); |
||||
ldapProvider.getConstructorArgumentValues().addGenericArgumentValue(authoritiesPopulator); |
||||
|
||||
registerPostProcessorIfNecessary(parserContext.getRegistry()); |
||||
|
||||
ConfigUtils.getRegisteredProviders(parserContext).add(ldapProvider); |
||||
|
||||
return null; |
||||
} |
||||
|
||||
// Todo: Move to utility class when we add ldap-user-service, as this check will be needed even if no
|
||||
// provider is added.
|
||||
private static class ContextSourceSettingPostProcessor implements BeanFactoryPostProcessor, Ordered { |
||||
|
||||
public void postProcessBeanFactory(ConfigurableListableBeanFactory bf) throws BeansException { |
||||
Map beans = bf.getBeansOfType(SpringSecurityContextSource.class); |
||||
|
||||
if (beans.size() == 0) { |
||||
throw new SecurityConfigurationException("No SpringSecurityContextSource instances found. Have you " + |
||||
"added an <" + Elements.LDAP_SERVER + " /> element to your application context?"); |
||||
} else if (beans.size() > 1) { |
||||
throw new SecurityConfigurationException("More than one SpringSecurityContextSource instance found. " + |
||||
"Please specify a specific server id when configuring your <" + Elements.LDAP_PROVIDER + ">"); |
||||
} |
||||
} |
||||
|
||||
public int getOrder() { |
||||
return LOWEST_PRECEDENCE; |
||||
} |
||||
|
||||
} |
||||
|
||||
public void registerPostProcessorIfNecessary(BeanDefinitionRegistry registry) { |
||||
if (registry.containsBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR)) { |
||||
return; |
||||
} |
||||
|
||||
registry.registerBeanDefinition(BeanIds.CONTEXT_SOURCE_SETTING_POST_PROCESSOR, |
||||
new RootBeanDefinition(LdapProviderBeanDefinitionParser.ContextSourceSettingPostProcessor.class)); |
||||
} |
||||
} |
||||
@ -0,0 +1,166 @@
@@ -0,0 +1,166 @@
|
||||
package org.springframework.security.config; |
||||
|
||||
import org.springframework.security.ldap.DefaultSpringSecurityContextSource; |
||||
import org.springframework.beans.factory.xml.BeanDefinitionParser; |
||||
import org.springframework.beans.factory.xml.ParserContext; |
||||
import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; |
||||
import org.springframework.beans.factory.config.BeanDefinition; |
||||
import org.springframework.beans.factory.support.RootBeanDefinition; |
||||
import org.springframework.ldap.core.DirContextAdapter; |
||||
import org.springframework.util.StringUtils; |
||||
import org.springframework.util.Assert; |
||||
|
||||
import org.w3c.dom.Element; |
||||
import org.apache.directory.server.configuration.MutableServerStartupConfiguration; |
||||
import org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration; |
||||
import org.apache.commons.logging.Log; |
||||
import org.apache.commons.logging.LogFactory; |
||||
|
||||
import javax.naming.NamingException; |
||||
import java.util.HashSet; |
||||
|
||||
/** |
||||
* @author Luke Taylor |
||||
* @version $Id$ |
||||
*/ |
||||
public class LdapServerBeanDefinitionParser implements BeanDefinitionParser { |
||||
private Log logger = LogFactory.getLog(getClass()); |
||||
|
||||
/** Defines the Url of the ldap server to use. If not specified, an embedded apache DS instance will be created */ |
||||
private static final String ATT_URL = "url"; |
||||
|
||||
private static final String ATT_PRINCIPAL = "manager-dn"; |
||||
private static final String ATT_PASSWORD = "manager-password"; |
||||
|
||||
// Properties which apply to embedded server only - when no Url is set
|
||||
|
||||
/** sets the configuration suffix (default is "dc=springframework,dc=org"). */ |
||||
public static final String ATT_ROOT_SUFFIX = "root"; |
||||
private static final String OPT_DEFAULT_ROOT_SUFFIX = "dc=springframework,dc=org"; |
||||
/** |
||||
* Optionally defines an ldif resource to be loaded. Otherwise an attempt will be made to load all ldif files |
||||
* found on the classpath. |
||||
*/ |
||||
public static final String ATT_LDIF_FILE = "ldif"; |
||||
private static final String OPT_DEFAULT_LDIF_FILE = "classpath*:*.ldif"; |
||||
|
||||
/** Defines the port the LDAP_PROVIDER server should run on */ |
||||
public static final String ATT_PORT = "port"; |
||||
public static final String OPT_DEFAULT_PORT = "33389"; |
||||
|
||||
|
||||
public BeanDefinition parse(Element elt, ParserContext parserContext) { |
||||
String url = elt.getAttribute(ATT_URL); |
||||
|
||||
RootBeanDefinition contextSource; |
||||
|
||||
if (!StringUtils.hasText(url)) { |
||||
contextSource = createEmbeddedServer(elt, parserContext); |
||||
} else { |
||||
contextSource = new RootBeanDefinition(DefaultSpringSecurityContextSource.class); |
||||
contextSource.getConstructorArgumentValues().addIndexedArgumentValue(0, url); |
||||
} |
||||
|
||||
String managerDn = elt.getAttribute(ATT_PRINCIPAL); |
||||
String managerPassword = elt.getAttribute(ATT_PASSWORD); |
||||
|
||||
if (StringUtils.hasText(managerDn)) { |
||||
Assert.hasText(managerPassword, "You must specify the " + ATT_PASSWORD + |
||||
" if you supply a " + managerDn); |
||||
|
||||
contextSource.getPropertyValues().addPropertyValue("userDn", managerDn); |
||||
contextSource.getPropertyValues().addPropertyValue("password", managerPassword); |
||||
} |
||||
|
||||
String id = elt.getAttribute(AbstractBeanDefinitionParser.ID_ATTRIBUTE); |
||||
|
||||
String contextSourceId = StringUtils.hasText(id) ? id : BeanIds.CONTEXT_SOURCE; |
||||
|
||||
parserContext.getRegistry().registerBeanDefinition(contextSourceId, contextSource); |
||||
|
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* Will be called if no url attribute is supplied. |
||||
* |
||||
* Registers beans to create an embedded apache directory server. |
||||
* |
||||
* @param element |
||||
* @param parserContext |
||||
* |
||||
* @return the BeanDefinition for the ContextSource for the embedded server. |
||||
* |
||||
* @see ApacheDSContainer |
||||
*/ |
||||
private RootBeanDefinition createEmbeddedServer(Element element, ParserContext parserContext) { |
||||
MutableServerStartupConfiguration configuration = new MutableServerStartupConfiguration(); |
||||
MutableBTreePartitionConfiguration partition = new MutableBTreePartitionConfiguration(); |
||||
|
||||
partition.setName("springsecurity"); |
||||
|
||||
DirContextAdapter rootContext = new DirContextAdapter(); |
||||
rootContext.setAttributeValues("objectClass", new String[] {"top", "domain", "extensibleObject"}); |
||||
rootContext.setAttributeValue("dc", "springsecurity"); |
||||
|
||||
partition.setContextEntry(rootContext.getAttributes()); |
||||
|
||||
String suffix = element.getAttribute(ATT_ROOT_SUFFIX); |
||||
|
||||
if (!StringUtils.hasText(suffix)) { |
||||
suffix = OPT_DEFAULT_ROOT_SUFFIX; |
||||
} |
||||
|
||||
try { |
||||
partition.setSuffix(suffix); |
||||
} catch (NamingException e) { |
||||
parserContext.getReaderContext().error("Failed to set root name suffix to " + suffix, element, e); |
||||
} |
||||
|
||||
HashSet partitions = new HashSet(1); |
||||
partitions.add(partition); |
||||
|
||||
String port = element.getAttribute(ATT_PORT); |
||||
|
||||
if (!StringUtils.hasText(port)) { |
||||
port = OPT_DEFAULT_PORT; |
||||
} |
||||
|
||||
configuration.setLdapPort(Integer.parseInt(port)); |
||||
|
||||
// We shut down the server ourself when the app context is closed so we don't need
|
||||
// the extra shutdown hook from apache DS itself.
|
||||
configuration.setShutdownHookEnabled(false); |
||||
configuration.setExitVmOnShutdown(false); |
||||
configuration.setContextPartitionConfigurations(partitions); |
||||
|
||||
String url = "ldap://127.0.0.1:" + port + "/" + suffix; |
||||
|
||||
RootBeanDefinition contextSource = new RootBeanDefinition(DefaultSpringSecurityContextSource.class); |
||||
contextSource.getConstructorArgumentValues().addIndexedArgumentValue(0, url); |
||||
contextSource.getPropertyValues().addPropertyValue("userDn", "uid=admin,ou=system"); |
||||
contextSource.getPropertyValues().addPropertyValue("password", "secret"); |
||||
|
||||
RootBeanDefinition apacheContainer = new RootBeanDefinition(ApacheDSContainer.class); |
||||
apacheContainer.getConstructorArgumentValues().addGenericArgumentValue(configuration); |
||||
apacheContainer.getConstructorArgumentValues().addGenericArgumentValue(contextSource); |
||||
|
||||
String ldifs = element.getAttribute(ATT_LDIF_FILE); |
||||
if (!StringUtils.hasText(ldifs)) { |
||||
ldifs = OPT_DEFAULT_LDIF_FILE; |
||||
} |
||||
|
||||
apacheContainer.getConstructorArgumentValues().addGenericArgumentValue(ldifs); |
||||
|
||||
logger.info("Embedded LDAP server bean created for URL: " + url); |
||||
|
||||
if (parserContext.getRegistry().containsBeanDefinition(BeanIds.EMBEDDED_APACHE_DS)) { |
||||
parserContext.getReaderContext().error("Only one embedded server bean is allowed per application context", |
||||
element); |
||||
} |
||||
|
||||
parserContext.getRegistry().registerBeanDefinition(BeanIds.EMBEDDED_APACHE_DS, apacheContainer); |
||||
|
||||
return contextSource; |
||||
} |
||||
} |
||||
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
package org.springframework.security.util; |
||||
|
||||
import org.springframework.context.support.AbstractXmlApplicationContext; |
||||
import org.springframework.core.io.Resource; |
||||
|
||||
/** |
||||
* @author Luke Taylor |
||||
* @version $Id$ |
||||
*/ |
||||
public class InMemoryXmlApplicationContext extends AbstractXmlApplicationContext { |
||||
private static final String BEANS_OPENING = |
||||
"<b:beans xmlns=\"http://www.springframework.org/schema/security\"\n" + |
||||
" xmlns:b=\"http://www.springframework.org/schema/beans\"\n" + |
||||
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + |
||||
" xsi:schemaLocation=\"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd\n" + |
||||
"http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd\">\n"; |
||||
private static final String BEANS_CLOSE = "</b:beans>\n"; |
||||
|
||||
Resource inMemoryXml; |
||||
|
||||
public InMemoryXmlApplicationContext(String xml) { |
||||
this(xml, true); |
||||
} |
||||
|
||||
public InMemoryXmlApplicationContext(String xml, boolean addBeansTags) { |
||||
String fullXml = addBeansTags ? BEANS_OPENING + xml + BEANS_CLOSE : xml; |
||||
inMemoryXml = new InMemoryResource(fullXml); |
||||
refresh(); |
||||
} |
||||
|
||||
protected Resource[] getConfigResources() { |
||||
return new Resource[] {inMemoryXml}; |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
new InMemoryXmlApplicationContext("<ldap-server />"); |
||||
} |
||||
} |
||||
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
package org.springframework.security.config; |
||||
|
||||
import org.springframework.security.providers.ProviderManager; |
||||
import org.springframework.security.providers.UsernamePasswordAuthenticationToken; |
||||
import org.springframework.security.providers.AuthenticationProvider; |
||||
import org.springframework.context.support.ClassPathXmlApplicationContext; |
||||
import org.springframework.beans.BeansException; |
||||
|
||||
import org.junit.BeforeClass; |
||||
import org.junit.AfterClass; |
||||
import org.junit.Test; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @author Luke Taylor |
||||
* @version $Id$ |
||||
*/ |
||||
public class AuthenticationProviderBeanDefinitionParserTests { |
||||
private static ClassPathXmlApplicationContext appContext; |
||||
|
||||
@BeforeClass |
||||
public static void loadContext() { |
||||
try { |
||||
appContext = new ClassPathXmlApplicationContext("org/springframework/security/config/auth-provider.xml"); |
||||
} catch (BeansException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
@AfterClass |
||||
public static void closeAppContext() { |
||||
if (appContext != null) { |
||||
appContext.close(); |
||||
} |
||||
} |
||||
|
||||
@Test |
||||
public void configuredProvidersAllAuthenticateUser() { |
||||
List<AuthenticationProvider> providers = |
||||
((ProviderManager)appContext.getBean(BeanIds.AUTHENTICATION_MANAGER)).getProviders(); |
||||
|
||||
UsernamePasswordAuthenticationToken bob = new UsernamePasswordAuthenticationToken("bob", "bobspassword"); |
||||
|
||||
for (AuthenticationProvider provider : providers) { |
||||
provider.authenticate(bob); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,49 @@
@@ -0,0 +1,49 @@
|
||||
package org.springframework.security.config; |
||||
|
||||
import org.springframework.security.providers.ProviderManager; |
||||
import org.springframework.security.providers.UsernamePasswordAuthenticationToken; |
||||
import org.springframework.security.providers.ldap.LdapAuthenticationProvider; |
||||
import org.springframework.security.Authentication; |
||||
import org.springframework.security.util.InMemoryXmlApplicationContext; |
||||
import org.springframework.security.userdetails.ldap.LdapUserDetailsImpl; |
||||
import static org.junit.Assert.*; |
||||
import org.junit.Test; |
||||
import org.junit.After; |
||||
|
||||
|
||||
/** |
||||
* @author luke |
||||
* @version $Id$ |
||||
*/ |
||||
public class LdapProviderBeanDefinitionParserTests { |
||||
InMemoryXmlApplicationContext appCtx; |
||||
|
||||
@After |
||||
public void closeAppContext() { |
||||
if (appCtx != null) { |
||||
appCtx.close(); |
||||
appCtx = null; |
||||
} |
||||
} |
||||
|
||||
@Test |
||||
public void simpleProviderAuthenticatesCorrectly() { |
||||
appCtx = new InMemoryXmlApplicationContext("<ldap-server /> <ldap-authentication-provider />"); |
||||
|
||||
ProviderManager authManager = (ProviderManager) appCtx.getBean(BeanIds.AUTHENTICATION_MANAGER); |
||||
|
||||
assertEquals(1, authManager.getProviders().size()); |
||||
|
||||
LdapAuthenticationProvider provider = (LdapAuthenticationProvider) authManager.getProviders().get(0); |
||||
Authentication auth = provider.authenticate(new UsernamePasswordAuthenticationToken("ben", "benspassword")); |
||||
LdapUserDetailsImpl ben = (LdapUserDetailsImpl) auth.getPrincipal(); |
||||
|
||||
assertEquals(2, ben.getAuthorities().length); |
||||
} |
||||
|
||||
@Test(expected = SecurityConfigurationException.class) |
||||
public void missingServerEltCausesConfigException() { |
||||
appCtx = new InMemoryXmlApplicationContext("<ldap-authentication-provider />"); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
package org.springframework.security.config; |
||||
|
||||
import org.springframework.security.util.InMemoryXmlApplicationContext; |
||||
import org.springframework.security.ldap.SpringSecurityContextSource; |
||||
|
||||
import org.springframework.ldap.core.support.BaseLdapPathContextSource; |
||||
import org.springframework.ldap.core.LdapTemplate; |
||||
|
||||
import org.junit.Test; |
||||
import org.junit.After; |
||||
|
||||
/** |
||||
* @author Luke Taylor |
||||
* @version $Id$ |
||||
*/ |
||||
public class LdapServerBeanDefinitionParserTests { |
||||
InMemoryXmlApplicationContext appCtx; |
||||
|
||||
@After |
||||
public void closeAppContext() { |
||||
if (appCtx != null) { |
||||
appCtx.close(); |
||||
appCtx = null; |
||||
} |
||||
} |
||||
|
||||
@Test |
||||
public void embeddedServerCreationContainsExpectedContextSourceAndData() { |
||||
appCtx = new InMemoryXmlApplicationContext("<ldap-server />"); |
||||
|
||||
SpringSecurityContextSource contextSource = (SpringSecurityContextSource) appCtx.getBean(BeanIds.CONTEXT_SOURCE); |
||||
|
||||
// Check data is loaded
|
||||
LdapTemplate template = new LdapTemplate(contextSource); |
||||
template.lookup("uid=ben,ou=people"); |
||||
} |
||||
|
||||
@Test |
||||
public void useOfUrlAttributeCreatesCorrectContextSource() { |
||||
// Create second "server" with a url pointing at embedded one
|
||||
appCtx = new InMemoryXmlApplicationContext("<ldap-server port=\"33388\"/>" + |
||||
"<ldap-server id=\"blah\" url=\"ldap://127.0.0.1:33388/dc=springframework,dc=org\" />"); |
||||
|
||||
// Check the default context source is still there.
|
||||
appCtx.getBean(BeanIds.CONTEXT_SOURCE); |
||||
|
||||
SpringSecurityContextSource contextSource = (SpringSecurityContextSource) appCtx.getBean("blah"); |
||||
|
||||
// Check data is loaded as before
|
||||
LdapTemplate template = new LdapTemplate(contextSource); |
||||
template.lookup("uid=ben,ou=people"); |
||||
} |
||||
|
||||
@Test |
||||
public void loadingSpecificLdifFileIsSuccessful() { |
||||
appCtx = new InMemoryXmlApplicationContext( |
||||
"<ldap-server ldif=\"classpath*:test-server2.xldif\" root=\"dc=monkeymachine,dc=co,dc=uk\" />"); |
||||
SpringSecurityContextSource contextSource = (SpringSecurityContextSource) appCtx.getBean(BeanIds.CONTEXT_SOURCE); |
||||
|
||||
LdapTemplate template = new LdapTemplate(contextSource); |
||||
template.lookup("uid=pg,ou=gorillas"); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/security" |
||||
xmlns:beans="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd |
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd"> |
||||
|
||||
<!-- All combinations should authenticate as bob/password --> |
||||
|
||||
<authentication-provider> |
||||
<user-service> |
||||
<user name="bob" password="bobspassword" authorities="ROLE_A" /> |
||||
</user-service> |
||||
</authentication-provider> |
||||
|
||||
<authentication-provider user-service-ref="myUserService" /> |
||||
|
||||
<user-service id="myUserService"> |
||||
<user name="bob" password="bobspassword" authorities="ROLE_A" /> |
||||
</user-service> |
||||
|
||||
<authentication-provider> |
||||
<password-encoder hash="md5"/> |
||||
<user-service> |
||||
<user name="bob" password="12b141f35d58b8b3a46eea65e6ac179e" authorities="ROLE_A" /> |
||||
</user-service> |
||||
</authentication-provider> |
||||
|
||||
<authentication-provider> |
||||
<password-encoder hash="{sha}"/> |
||||
<user-service> |
||||
<user name="bob" password="{SSHA}PpuEwfdj7M1rs0C2W4ssSM2XEN/Y6S5U" authorities="ROLE_A" /> |
||||
</user-service> |
||||
</authentication-provider> |
||||
|
||||
</beans:beans> |
||||
@ -1,13 +1,13 @@
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:security="http://www.springframework.org/schema/security" |
||||
<b:beans xmlns="http://www.springframework.org/schema/security" |
||||
xmlns:b="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd |
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd"> |
||||
|
||||
|
||||
<security:ldap /> |
||||
|
||||
<ldap-server ldif="classpath*:test-server2.xldif" root="dc=monkeymachine,dc=co,dc=uk" /> |
||||
|
||||
</beans> |
||||
|
||||
</b:beans> |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
dn: ou=gorillas,dc=monkeymachine,dc=co,dc=uk |
||||
objectclass: top |
||||
objectclass: organizationalUnit |
||||
ou: gorillas |
||||
|
||||
dn: uid=pg,ou=gorillas,dc=monkeymachine,dc=co,dc=uk |
||||
objectclass: top |
||||
objectclass: person |
||||
objectclass: organizationalPerson |
||||
objectclass: inetOrgPerson |
||||
cn: Pierre |
||||
sn: Gorille |
||||
uid: pg |
||||
userPassword: password |
||||
|
||||
|
||||
Loading…
Reference in new issue