Improve LDAP security DAO
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 16:22:25 +0000 (16:22 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 17 Mar 2011 16:22:25 +0000 (16:22 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4318 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

demo/argeo-node-web.properties
security/modules/org.argeo.security.dao.admin.ldap/.project [deleted file]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/MANIFEST.MF [deleted file]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap-osgi.xml [deleted file]
security/modules/org.argeo.security.dao.admin.ldap/META-INF/spring/ldap.xml [deleted file]
security/modules/org.argeo.security.dao.admin.ldap/build.properties [deleted file]
security/modules/org.argeo.security.dao.admin.ldap/ldap.properties [deleted file]
security/modules/org.argeo.security.dao.ldap/.project
security/modules/org.argeo.security.dao.ldap/META-INF/MANIFEST.MF
security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap-osgi.xml
security/modules/org.argeo.security.dao.ldap/META-INF/spring/ldap.xml

index 477bafdf776e6a1525dc733c2be99bb746e3f012..726f225c305ba75ca81a18f4201a127a6653cb3c 100644 (file)
@@ -2,7 +2,7 @@ argeo.osgi.start=\
 org.springframework.osgi.extender,\
 org.argeo.server.ads.server,\
 org.argeo.node.repo.jackrabbit,\
-org.argeo.security.manager.ldap,\
+org.argeo.security.dao.ldap,\
 org.argeo.security.services,\
 org.argeo.security.services.admin,\
 com.springsource.javax.servlet,\
diff --git a/security/modules/org.argeo.security.dao.admin.ldap/.project b/security/modules/org.argeo.security.dao.admin.ldap/.project
deleted file mode 100644 (file)
index b79fc94..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?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
deleted file mode 100644 (file)
index b6100ab..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-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
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.dao.admin.ldap/META-INF/spring/ldap.xml b/security/modules/org.argeo.security.dao.admin.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.dao.admin.ldap/build.properties b/security/modules/org.argeo.security.dao.admin.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.dao.admin.ldap/ldap.properties b/security/modules/org.argeo.security.dao.admin.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
index 6de38255f089b762853791255848ac30411702fc..cd8b39380012fc6d33ac47333889e0cd956d6920 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>org.argeo.security.manager.ldap</name>
+       <name>org.argeo.security.dao.ldap</name>
        <comment></comment>
        <projects>
        </projects>
index 5325587bb713daea564007ad035f1680ef7094f8..85bbf4b21783e2ab2813061526773b4406c80f0c 100644 (file)
@@ -1,18 +1,17 @@
-Bundle-SymbolicName: org.argeo.security.manager.ldap
+Bundle-SymbolicName: org.argeo.security.dao.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.encoding,
  org.springframework.security.providers.ldap,
  org.springframework.security.providers.ldap.authenticator,
  org.springframework.security.userdetails,
index 7a0fa89fac7290b2e160c108f42318a6f71e9f3a..3ae43c3307780e0bd0676038d6b7129c84dd3769 100644 (file)
        <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
index 2f65ebe826b84d20aa2ab2f241885ea295bef4ea..fdf216444959cc4debf337431a249f3357e3774e 100644 (file)
@@ -53,9 +53,6 @@
                                <value>uid={0},ou=People</value>
                        </list>
                </property>
-               <property name="passwordEncoder">
-                       <bean
-                               class="org.springframework.security.providers.ldap.authenticator.LdapShaPasswordEncoder" />
-               </property>
+               <property name="passwordEncoder" ref="passwordEncoder" />
        </bean>
 </beans>