Introduce LDAP saos
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 15:48:48 +0000 (15:48 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 15:48:48 +0000 (15:48 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4316 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

20 files changed:
security/modules/org.argeo.security.dao.admin.ldap/.project [new file with mode: 0644]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/MANIFEST.MF [new file with mode: 0644]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap-osgi.xml [new file with mode: 0644]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap.xml [new file with mode: 0644]
security/modules/org.argeo.security.dao.admin.ldap/build.properties [new file with mode: 0644]
security/modules/org.argeo.security.dao.admin.ldap/ldap.properties [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/.project [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/META-INF/MANIFEST.MF [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap-osgi.xml [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap.xml [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/META-INF/spring/natures-osgi.xml [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/build.properties [new file with mode: 0644]
security/modules/org.argeo.security.dao.ldap/ldap.properties [new file with mode: 0644]
security/modules/org.argeo.security.manager.ldap/.project [deleted file]
security/modules/org.argeo.security.manager.ldap/META-INF/MANIFEST.MF [deleted file]
security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap-osgi.xml [deleted file]
security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap.xml [deleted file]
security/modules/org.argeo.security.manager.ldap/META-INF/spring/natures-osgi.xml [deleted file]
security/modules/org.argeo.security.manager.ldap/build.properties [deleted file]
security/modules/org.argeo.security.manager.ldap/ldap.properties [deleted file]

diff --git a/security/modules/org.argeo.security.dao.admin.ldap/.project b/security/modules/org.argeo.security.dao.admin.ldap/.project
new file mode 100644 (file)
index 0000000..b79fc94
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.dao.admin.ldap</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.dao.admin.ldap/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..b6100ab
--- /dev/null
@@ -0,0 +1,20 @@
+Bundle-SymbolicName: org.argeo.security.dao.admin.ldap
+Bundle-Version: 0.2.3.SNAPSHOT
+Import-Package: com.sun.jndi.ldap;resolution:=optional,
+ org.argeo.security,
+ org.argeo.security.ldap,
+ org.argeo.security.ldap.nature,
+ org.argeo.security.nature,
+ org.argeo.server.json;resolution:=optional,
+ org.springframework.beans.factory.config,
+ org.springframework.ldap.core.support,
+ org.springframework.security,
+ org.springframework.security.ldap,
+ org.springframework.security.ldap.populator,
+ org.springframework.security.providers,
+ org.springframework.security.providers.encoding;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers.ldap,
+ org.springframework.security.providers.ldap.authenticator,
+ org.springframework.security.userdetails,
+ org.springframework.security.userdetails.ldap
+Bundle-Name: Security Manager LDAP
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap-osgi.xml b/security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap-osgi.xml
new file mode 100644 (file)
index 0000000..7a0fa89
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <!-- REFERENCES -->\r
+       <list id="userNatureMappers" interface="org.argeo.security.ldap.UserNatureMapper"\r
+               cardinality="0..N" />\r
+\r
+       <!-- SERVICES -->\r
+       <service ref="authenticationProvider"\r
+               interface="org.springframework.security.providers.AuthenticationProvider"\r
+               context-class-loader="service-provider" />\r
+       <service ref="securityDao" interface="org.argeo.security.CurrentUserDao"\r
+               context-class-loader="service-provider" />\r
+       <service ref="securityDao" interface="org.argeo.security.UserAdminDao"\r
+               context-class-loader="service-provider" />\r
+       <service ref="userDetailsService"\r
+               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               context-class-loader="service-provider" />\r
+\r
+       <!-- Provides deserialization -->\r
+       <service interface="org.argeo.server.json.JsonObjectFactory">\r
+               <beans:bean class="org.argeo.server.json.JsonObjectFactoryImpl" />\r
+       </service>\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap.xml b/security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap.xml
new file mode 100644 (file)
index 0000000..2f65ebe
--- /dev/null
@@ -0,0 +1,61 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:security="http://www.springframework.org/schema/security"
+       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.4.xsd">
+
+
+       <bean
+               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+               <property name="locations">
+                       <value>osgibundle:ldap.properties</value>
+               </property>
+       </bean>
+
+       <bean id="passwordEncoder"
+               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+
+       <bean id="contextSource"
+               class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
+               <constructor-arg
+                       value="${argeo.ldap.protocol}://${argeo.ldap.host}:${argeo.ldap.port}/${argeo.ldap.rootdn}" />
+               <property name="userDn" value="${argeo.ldap.manager.userdn}" />
+               <property name="password" value="${argeo.ldap.manager.password}" />
+       </bean>
+
+       <bean id="authenticationProvider"
+               class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
+               <constructor-arg ref="ldapAuthenticator" />
+               <constructor-arg>
+                       <bean factory-bean="securityDao" factory-method="getAuthoritiesPopulator" />
+               </constructor-arg>
+               <property name="userDetailsContextMapper">
+                       <bean factory-bean="securityDao" factory-method="getUserDetailsMapper" />
+               </property>
+       </bean>
+
+       <bean id="securityDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
+               <constructor-arg ref="contextSource" />
+               <property name="userNatureMappers" ref="userNatureMappers" />
+               <property name="passwordEncoder" ref="passwordEncoder" />
+       </bean>
+
+       <bean id="userDetailsService" factory-bean="securityDao"
+               factory-method="getUserDetailsService">
+       </bean>
+
+       <bean id="ldapAuthenticator"
+               class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
+               <constructor-arg ref="contextSource" />
+               <property name="userDnPatterns">
+                       <list>
+                               <value>uid={0},ou=People</value>
+                       </list>
+               </property>
+               <property name="passwordEncoder">
+                       <bean
+                               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+               </property>
+       </bean>
+</beans>
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/build.properties b/security/modules/org.argeo.security.dao.admin.ldap/build.properties
new file mode 100644 (file)
index 0000000..5f22cdd
--- /dev/null
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/ldap.properties b/security/modules/org.argeo.security.dao.admin.ldap/ldap.properties
new file mode 100644 (file)
index 0000000..1b24ee3
--- /dev/null
@@ -0,0 +1,6 @@
+argeo.ldap.rootdn=dc=demo,dc=argeo,dc=org
+argeo.ldap.protocol=ldap
+argeo.ldap.host=localhost
+argeo.ldap.port=10389
+argeo.ldap.manager.userdn=uid=admin,ou=system
+argeo.ldap.manager.password=secret
diff --git a/security/modules/org.argeo.security.dao.ldap/.project b/security/modules/org.argeo.security.dao.ldap/.project
new file mode 100644 (file)
index 0000000..6de3825
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.manager.ldap</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/modules/org.argeo.security.dao.ldap/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.dao.ldap/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..5325587
--- /dev/null
@@ -0,0 +1,20 @@
+Bundle-SymbolicName: org.argeo.security.manager.ldap
+Bundle-Version: 0.2.3.SNAPSHOT
+Import-Package: com.sun.jndi.ldap;resolution:=optional,
+ org.argeo.security,
+ org.argeo.security.ldap,
+ org.argeo.security.ldap.nature,
+ org.argeo.security.nature,
+ org.argeo.server.json;resolution:=optional,
+ org.springframework.beans.factory.config,
+ org.springframework.ldap.core.support,
+ org.springframework.security,
+ org.springframework.security.ldap,
+ org.springframework.security.ldap.populator,
+ org.springframework.security.providers,
+ org.springframework.security.providers.encoding;specification-version="2.0.6.RELEASE",
+ org.springframework.security.providers.ldap,
+ org.springframework.security.providers.ldap.authenticator,
+ org.springframework.security.userdetails,
+ org.springframework.security.userdetails.ldap
+Bundle-Name: Security Manager LDAP
diff --git a/security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap-osgi.xml b/security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap-osgi.xml
new file mode 100644 (file)
index 0000000..7a0fa89
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <!-- REFERENCES -->\r
+       <list id="userNatureMappers" interface="org.argeo.security.ldap.UserNatureMapper"\r
+               cardinality="0..N" />\r
+\r
+       <!-- SERVICES -->\r
+       <service ref="authenticationProvider"\r
+               interface="org.springframework.security.providers.AuthenticationProvider"\r
+               context-class-loader="service-provider" />\r
+       <service ref="securityDao" interface="org.argeo.security.CurrentUserDao"\r
+               context-class-loader="service-provider" />\r
+       <service ref="securityDao" interface="org.argeo.security.UserAdminDao"\r
+               context-class-loader="service-provider" />\r
+       <service ref="userDetailsService"\r
+               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               context-class-loader="service-provider" />\r
+\r
+       <!-- Provides deserialization -->\r
+       <service interface="org.argeo.server.json.JsonObjectFactory">\r
+               <beans:bean class="org.argeo.server.json.JsonObjectFactoryImpl" />\r
+       </service>\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap.xml b/security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap.xml
new file mode 100644 (file)
index 0000000..2f65ebe
--- /dev/null
@@ -0,0 +1,61 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:security="http://www.springframework.org/schema/security"
+       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.4.xsd">
+
+
+       <bean
+               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+               <property name="locations">
+                       <value>osgibundle:ldap.properties</value>
+               </property>
+       </bean>
+
+       <bean id="passwordEncoder"
+               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+
+       <bean id="contextSource"
+               class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
+               <constructor-arg
+                       value="${argeo.ldap.protocol}://${argeo.ldap.host}:${argeo.ldap.port}/${argeo.ldap.rootdn}" />
+               <property name="userDn" value="${argeo.ldap.manager.userdn}" />
+               <property name="password" value="${argeo.ldap.manager.password}" />
+       </bean>
+
+       <bean id="authenticationProvider"
+               class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
+               <constructor-arg ref="ldapAuthenticator" />
+               <constructor-arg>
+                       <bean factory-bean="securityDao" factory-method="getAuthoritiesPopulator" />
+               </constructor-arg>
+               <property name="userDetailsContextMapper">
+                       <bean factory-bean="securityDao" factory-method="getUserDetailsMapper" />
+               </property>
+       </bean>
+
+       <bean id="securityDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
+               <constructor-arg ref="contextSource" />
+               <property name="userNatureMappers" ref="userNatureMappers" />
+               <property name="passwordEncoder" ref="passwordEncoder" />
+       </bean>
+
+       <bean id="userDetailsService" factory-bean="securityDao"
+               factory-method="getUserDetailsService">
+       </bean>
+
+       <bean id="ldapAuthenticator"
+               class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
+               <constructor-arg ref="contextSource" />
+               <property name="userDnPatterns">
+                       <list>
+                               <value>uid={0},ou=People</value>
+                       </list>
+               </property>
+               <property name="passwordEncoder">
+                       <bean
+                               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
+               </property>
+       </bean>
+</beans>
diff --git a/security/modules/org.argeo.security.dao.ldap/META-INF/spring/natures-osgi.xml b/security/modules/org.argeo.security.dao.ldap/META-INF/spring/natures-osgi.xml
new file mode 100644 (file)
index 0000000..6f7c1e5
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+       <service interface="org.argeo.security.ldap.UserNatureMapper">\r
+               <beans:bean name="simpleUser" class="org.argeo.security.ldap.nature.SimpleUserNatureMapper" />\r
+       </service>\r
+\r
+       <service interface="org.argeo.security.ldap.UserNatureMapper">\r
+               <beans:bean name="coworker" class="org.argeo.security.ldap.nature.CoworkerUserNatureMapper" />\r
+       </service>\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.dao.ldap/build.properties b/security/modules/org.argeo.security.dao.ldap/build.properties
new file mode 100644 (file)
index 0000000..5f22cdd
--- /dev/null
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/security/modules/org.argeo.security.dao.ldap/ldap.properties b/security/modules/org.argeo.security.dao.ldap/ldap.properties
new file mode 100644 (file)
index 0000000..1b24ee3
--- /dev/null
@@ -0,0 +1,6 @@
+argeo.ldap.rootdn=dc=demo,dc=argeo,dc=org
+argeo.ldap.protocol=ldap
+argeo.ldap.host=localhost
+argeo.ldap.port=10389
+argeo.ldap.manager.userdn=uid=admin,ou=system
+argeo.ldap.manager.password=secret
diff --git a/security/modules/org.argeo.security.manager.ldap/.project b/security/modules/org.argeo.security.manager.ldap/.project
deleted file mode 100644 (file)
index 6de3825..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.security.manager.ldap</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-       </natures>
-</projectDescription>
diff --git a/security/modules/org.argeo.security.manager.ldap/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.manager.ldap/META-INF/MANIFEST.MF
deleted file mode 100644 (file)
index 5325587..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Bundle-SymbolicName: org.argeo.security.manager.ldap
-Bundle-Version: 0.2.3.SNAPSHOT
-Import-Package: com.sun.jndi.ldap;resolution:=optional,
- org.argeo.security,
- org.argeo.security.ldap,
- org.argeo.security.ldap.nature,
- org.argeo.security.nature,
- org.argeo.server.json;resolution:=optional,
- org.springframework.beans.factory.config,
- org.springframework.ldap.core.support,
- org.springframework.security,
- org.springframework.security.ldap,
- org.springframework.security.ldap.populator,
- org.springframework.security.providers,
- org.springframework.security.providers.encoding;specification-version="2.0.6.RELEASE",
- org.springframework.security.providers.ldap,
- org.springframework.security.providers.ldap.authenticator,
- org.springframework.security.userdetails,
- org.springframework.security.userdetails.ldap
-Bundle-Name: Security Manager LDAP
diff --git a/security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap-osgi.xml b/security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap-osgi.xml
deleted file mode 100644 (file)
index 7a0fa89..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
-       <!-- REFERENCES -->\r
-       <list id="userNatureMappers" interface="org.argeo.security.ldap.UserNatureMapper"\r
-               cardinality="0..N" />\r
-\r
-       <!-- SERVICES -->\r
-       <service ref="authenticationProvider"\r
-               interface="org.springframework.security.providers.AuthenticationProvider"\r
-               context-class-loader="service-provider" />\r
-       <service ref="securityDao" interface="org.argeo.security.CurrentUserDao"\r
-               context-class-loader="service-provider" />\r
-       <service ref="securityDao" interface="org.argeo.security.UserAdminDao"\r
-               context-class-loader="service-provider" />\r
-       <service ref="userDetailsService"\r
-               interface="org.springframework.security.userdetails.UserDetailsService"\r
-               context-class-loader="service-provider" />\r
-\r
-       <!-- Provides deserialization -->\r
-       <service interface="org.argeo.server.json.JsonObjectFactory">\r
-               <beans:bean class="org.argeo.server.json.JsonObjectFactoryImpl" />\r
-       </service>\r
-\r
-</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap.xml b/security/modules/org.argeo.security.manager.ldap/META-INF/spring/ldap.xml
deleted file mode 100644 (file)
index 2f65ebe..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:security="http://www.springframework.org/schema/security"
-       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.4.xsd">
-
-
-       <bean
-               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
-               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
-               <property name="locations">
-                       <value>osgibundle:ldap.properties</value>
-               </property>
-       </bean>
-
-       <bean id="passwordEncoder"
-               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
-
-       <bean id="contextSource"
-               class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
-               <constructor-arg
-                       value="${argeo.ldap.protocol}://${argeo.ldap.host}:${argeo.ldap.port}/${argeo.ldap.rootdn}" />
-               <property name="userDn" value="${argeo.ldap.manager.userdn}" />
-               <property name="password" value="${argeo.ldap.manager.password}" />
-       </bean>
-
-       <bean id="authenticationProvider"
-               class="org.springframework.security.providers.ldap.LdapAuthenticationProvider">
-               <constructor-arg ref="ldapAuthenticator" />
-               <constructor-arg>
-                       <bean factory-bean="securityDao" factory-method="getAuthoritiesPopulator" />
-               </constructor-arg>
-               <property name="userDetailsContextMapper">
-                       <bean factory-bean="securityDao" factory-method="getUserDetailsMapper" />
-               </property>
-       </bean>
-
-       <bean id="securityDao" class="org.argeo.security.ldap.ArgeoSecurityDaoLdap">
-               <constructor-arg ref="contextSource" />
-               <property name="userNatureMappers" ref="userNatureMappers" />
-               <property name="passwordEncoder" ref="passwordEncoder" />
-       </bean>
-
-       <bean id="userDetailsService" factory-bean="securityDao"
-               factory-method="getUserDetailsService">
-       </bean>
-
-       <bean id="ldapAuthenticator"
-               class="org.springframework.security.providers.ldap.authenticator.PasswordComparisonAuthenticator">
-               <constructor-arg ref="contextSource" />
-               <property name="userDnPatterns">
-                       <list>
-                               <value>uid={0},ou=People</value>
-                       </list>
-               </property>
-               <property name="passwordEncoder">
-                       <bean
-                               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
-               </property>
-       </bean>
-</beans>
diff --git a/security/modules/org.argeo.security.manager.ldap/META-INF/spring/natures-osgi.xml b/security/modules/org.argeo.security.manager.ldap/META-INF/spring/natures-osgi.xml
deleted file mode 100644 (file)
index 6f7c1e5..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
-\r
-       <service interface="org.argeo.security.ldap.UserNatureMapper">\r
-               <beans:bean name="simpleUser" class="org.argeo.security.ldap.nature.SimpleUserNatureMapper" />\r
-       </service>\r
-\r
-       <service interface="org.argeo.security.ldap.UserNatureMapper">\r
-               <beans:bean name="coworker" class="org.argeo.security.ldap.nature.CoworkerUserNatureMapper" />\r
-       </service>\r
-\r
-</beans:beans>
\ No newline at end of file
diff --git a/security/modules/org.argeo.security.manager.ldap/build.properties b/security/modules/org.argeo.security.manager.ldap/build.properties
deleted file mode 100644 (file)
index 5f22cdd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bin.includes = META-INF/
diff --git a/security/modules/org.argeo.security.manager.ldap/ldap.properties b/security/modules/org.argeo.security.manager.ldap/ldap.properties
deleted file mode 100644 (file)
index 1b24ee3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-argeo.ldap.rootdn=dc=demo,dc=argeo,dc=org
-argeo.ldap.protocol=ldap
-argeo.ldap.host=localhost
-argeo.ldap.port=10389
-argeo.ldap.manager.userdn=uid=admin,ou=system
-argeo.ldap.manager.password=secret