Adapt to changes in third parties
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 3 Jan 2015 15:28:28 +0000 (15:28 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 3 Jan 2015 15:28:28 +0000 (15:28 +0000)
git-svn-id: https://svn.argeo.org/commons/branches/mbaudier.2.tp@7624 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

19 files changed:
demo/argeo_node_cms.properties
demo/argeo_node_rap.properties
org.argeo.cms/META-INF/spring/osgi.xml
org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml
org.argeo.security.auth.ldap/META-INF/spring/security-ldap-osgi.xml
org.argeo.security.auth.ldap/META-INF/spring/security-ldap-services.xml
org.argeo.security.core/src/org/argeo/security/core/InternalAuthenticationProvider.java [new file with mode: 0644]
org.argeo.security.dao.cli/META-INF/spring/security-cli-osgi.xml
org.argeo.security.dao.cli/META-INF/spring/security-cli.xml
org.argeo.security.dao.jackrabbit/META-INF/spring/remote.xml
org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-osgi.xml
org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-services.xml
org.argeo.security.dao.ldap/META-INF/spring/security-ldap-osgi.xml
org.argeo.security.dao.ldap/META-INF/spring/security-ldap-services.xml
org.argeo.security.dao.os/META-INF/spring/security-os-osgi.xml
org.argeo.security.dao.os/META-INF/spring/security-os.xml
org.argeo.security.equinox/META-INF/spring/osgi.xml
org.argeo.security.ui.rap/META-INF/spring/osgi.xml
org.argeo.server.rap.webapp/WEB-INF/osgi.xml

index d53298060b0b1ca069bdaa2bb79d7da16fd9460e..aba171da5af95fe20d0eb8a71fa8581adf15dee5 100644 (file)
@@ -1,5 +1,5 @@
 argeo.osgi.start.1.node=\
-org.springframework.osgi.extender,\
+org.eclipse.gemini.blueprint.extender
 
 argeo.osgi.start.3.node=\
 org.argeo.node.repo.jackrabbit,\
index c04eea2a74e2d829ff13916030e23f7c480a4bb1..8596df8043e09e65895338f7d304cca15d9df9be 100644 (file)
@@ -1,5 +1,5 @@
 argeo.osgi.start.1.node=\
-org.springframework.osgi.extender
+org.eclipse.gemini.blueprint.extender
 
 #org.argeo.server.ads.server,\
 
index 4b517877907704f3d894e5eefc25f67f8ac73dc3..48609a1e47eab49eff98a840c1d2cbaa2ae4b5ab 100644 (file)
@@ -11,7 +11,7 @@
                filter="(argeo.jcr.repository.alias=node)" />\r
 \r
        <reference id="authenticationManager"\r
-               interface="org.springframework.security.core.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
 \r
        <!-- SERVICES -->\r
        <service ref="cmsRepository" interface="javax.jcr.Repository">\r
index b4a3c48df6436f736d63462e6243d9900175fd91..089c71559aa7ea2d92cf314d7c54853e4aecbb15 100644 (file)
@@ -22,7 +22,7 @@
        <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
 \r
        <reference id="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
        <reference id="userDetailsService"\r
-               interface="org.springframework.security.userdetails.UserDetailsService" />\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService" />\r
 </beans:beans>
\ No newline at end of file
index d817f96441a96d0dfddc9db6721a948e18a599f4..c03964209220854db2a88b939af1f8725f9c1573 100644 (file)
 \r
        <!-- SERVICES -->\r
        <service ref="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager"\r
+               interface="org.springframework.security.authentication.AuthenticationManager"\r
                context-class-loader="service-provider" />\r
 \r
        <!-- User management -->\r
 <!--   <service ref="userDetailsManager" -->\r
-<!--           interface="org.springframework.security.userdetails.UserDetailsService" -->\r
+<!--           interface="org.springframework.security.core.userdetails.UserDetailsService" -->\r
 <!--           context-class-loader="service-provider" /> -->\r
 <!--   <service ref="userDetailsManager" -->\r
-<!--           interface="org.springframework.security.userdetails.UserDetailsManager" -->\r
+<!--           interface="org.springframework.security.provisioning.UserDetailsManager" -->\r
 <!--           context-class-loader="service-provider" /> -->\r
 <!--   <service ref="userDetailsManager" interface="org.argeo.security.UserAdminService" -->\r
 <!--           context-class-loader="service-provider" /> -->\r
index 0b9a8b8f0bfe1bec6a21368de84e6e894ea01d5d..6fcf77dea4759c7c4bf4817618c1aae337523518 100644 (file)
@@ -4,7 +4,7 @@
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
-       <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
@@ -35,7 +35,7 @@
 <!--   </bean> -->
 
        <bean id="anonymousAuthenticationProvider"
-               class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider">
+               class="org.springframework.security.authentication.AnonymousAuthenticationProvider">
                <description><![CDATA[Anonymous authentication]]></description>
                <property name="key" value="${argeo.security.systemKey}" />
        </bean>
@@ -50,7 +50,7 @@
                initialization himself, in order to prevent the following dependency cycle: 
                Repository.login() <= AuthenticationManager <= LdapAuthenticationProvider 
                <= Repository.login() in init() -->
-       <bean id="internalAuthenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="internalAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
diff --git a/org.argeo.security.core/src/org/argeo/security/core/InternalAuthenticationProvider.java b/org.argeo.security.core/src/org/argeo/security/core/InternalAuthenticationProvider.java
new file mode 100644 (file)
index 0000000..0efabcd
--- /dev/null
@@ -0,0 +1,28 @@
+package org.argeo.security.core;
+
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+
+public class InternalAuthenticationProvider implements AuthenticationProvider {
+       private String key;
+
+       @Override
+       public Authentication authenticate(Authentication arg0)
+                       throws AuthenticationException {
+               InternalAuthentication authentication = (InternalAuthentication) arg0;
+               if (authentication.getCredentials().toString().equals(key))
+                       return authentication;
+               return null;
+       }
+
+       public void setKey(String key) {
+               this.key = key;
+       }
+
+       @Override
+       public boolean supports(Class<?> authentication) {
+               return InternalAuthentication.class.isAssignableFrom(authentication);
+       }
+
+}
index c46f2764ce19fb879c4fbd3f28ecaecabeebd9c7..f2bcd97b745d7cce41559d38cc188e67768714bd 100644 (file)
 \r
        <!-- SERVICES -->\r
        <service ref="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
 \r
        <!-- User management -->\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsManager"\r
+               interface="org.springframework.security.provisioning.UserDetailsManager"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager" interface="org.argeo.security.UserAdminService"\r
                context-class-loader="service-provider" />\r
index c3f6c812232f7cc51e0ef9f825eb4914497464a1..a9102edc8d8e95c3e335ac76c8b8c7d7026b68d2 100644 (file)
@@ -23,7 +23,7 @@
                <property name="bundleContext" ref="bundleContext" />
        </bean>
 
-       <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
@@ -51,7 +51,7 @@
                himself, in order to prevent the following dependency cycle: Repository.login() 
                <= AuthenticationManager <= osJcrAuthenticationProvider <= Repository.login() 
                in init() -->
-       <bean id="internalAuthenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="internalAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
index ff62a5c646372b959bf8ae40e1457adb2b123e16..b44585dc0374d777ee34e681bcae805660c3a213 100644 (file)
@@ -9,7 +9,7 @@
        <!-- <property name="bundleContext" ref="bundleContext" /> -->
        <!-- </bean> -->
 
-       <!-- <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager"> -->
+       <!-- <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager"> -->
        <!-- <property name="providers"> -->
        <!-- <list> -->
        <!-- <ref bean="authByAdapterProvider" /> -->
index 3d3f4010f7c9d5e0220284e78fe3a91ef43a99b5..7ca23acfaf31905f2075d53291724ab997c304c8 100644 (file)
 \r
        <!-- SERVICES -->\r
        <service ref="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
 \r
        <!-- User management -->\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsService" />\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService" />\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsManager" />\r
+               interface="org.springframework.security.provisioning.UserDetailsManager" />\r
        <service ref="userDetailsManager" interface="org.argeo.security.UserAdminService" />\r
 \r
 </beans:beans>
\ No newline at end of file
index 7f276a27131ca83ba0e2fb7f426e8a3502167cae..1923d1023a8b8351e6006bc385e090675a324ced 100644 (file)
@@ -12,7 +12,8 @@
                </property>
        </bean>
 
-       <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="authenticationManager"
+               class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
        </bean>
 
        <!-- Authentication providers -->
-       <bean id="authByAdapterProvider"
-               class="org.springframework.security.adapters.AuthByAdapterProvider">
+       <bean id="authByAdapterProvider" class="org.argeo.security.core.InternalAuthenticationProvider">
                <property name="key" value="${argeo.security.systemKey}" />
        </bean>
 
        <bean id="anonymousAuthenticationProvider"
-               class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider">
+               class="org.springframework.security.authentication.AnonymousAuthenticationProvider">
                <description><![CDATA[Anonymous authentication]]></description>
                <property name="key" value="${argeo.security.systemKey}" />
        </bean>
@@ -61,7 +61,8 @@
                initialization himself, in order to prevent the following dependency cycle: 
                Repository.login() <= AuthenticationManager <= JackrabbitUserAdminService 
                <= Repository.login() in init() -->
-       <bean id="internalAuthenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="internalAuthenticationManager"
+               class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
index aa3b67ac64e222245415f0eb39c7165ed812e8de..9e6e3f24bcca404ef0f00f5a31fac9c5d699004d 100644 (file)
 \r
        <!-- SERVICES -->\r
        <service ref="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager"\r
+               interface="org.springframework.security.authentication.AuthenticationManager"\r
                context-class-loader="service-provider" />\r
 \r
        <!-- User management -->\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsManager"\r
+               interface="org.springframework.security.provisioning.UserDetailsManager"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager" interface="org.argeo.security.UserAdminService"\r
                context-class-loader="service-provider" />\r
index 36dedf3891587823d384000e6f777dea902e1b01..9a2f2d1d42744eebe137d87ac350efc35b512db7 100644 (file)
@@ -4,7 +4,7 @@
        xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
-       <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
@@ -35,7 +35,7 @@
        </bean>
 
        <bean id="anonymousAuthenticationProvider"
-               class="org.springframework.security.providers.anonymous.AnonymousAuthenticationProvider">
+               class="org.springframework.security.authentication.AnonymousAuthenticationProvider">
                <description><![CDATA[Anonymous authentication]]></description>
                <property name="key" value="${argeo.security.systemKey}" />
        </bean>
@@ -50,7 +50,7 @@
                initialization himself, in order to prevent the following dependency cycle: 
                Repository.login() <= AuthenticationManager <= LdapAuthenticationProvider 
                <= Repository.login() in init() -->
-       <bean id="internalAuthenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="internalAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
index 5d827b4a5ba96025d10b8da1918baffc844cf837..0a605c7b82964c5d110f1a9baae43ec2f61af0e1 100644 (file)
 \r
        <!-- SERVICES -->\r
        <service ref="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
 \r
        <!-- User management -->\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsManager"\r
+               interface="org.springframework.security.provisioning.UserDetailsManager"\r
                context-class-loader="service-provider" />\r
        <service ref="userDetailsManager" interface="org.argeo.security.UserAdminService"\r
                context-class-loader="service-provider" />\r
index 3d94f502d4aa7fe3f98c2934ef6a679e03065691..d80084dfe3c60bba2ffc6f07708372720d8cffbf 100644 (file)
@@ -23,7 +23,7 @@
                <property name="bundleContext" ref="bundleContext" />
        </bean>
 
-       <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
@@ -51,7 +51,7 @@
                himself, in order to prevent the following dependency cycle: Repository.login() 
                <= AuthenticationManager <= osJcrAuthenticationProvider <= Repository.login() 
                in init() -->
-       <bean id="internalAuthenticationManager" class="org.springframework.security.providers.ProviderManager">
+       <bean id="internalAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
                <property name="providers">
                        <list>
                                <ref bean="authByAdapterProvider" />
index 9e411ea00cee70fa9fae5c262533a9a67b972131..17ece3a08a54175e9a3d7efb12fd0fc5d88f5977 100644 (file)
@@ -9,6 +9,6 @@
        osgi:default-timeout="30000">\r
 \r
        <reference id="authenticationManager"\r
-               interface="org.springframework.security.core.AuthenticationManager"\r
+               interface="org.springframework.security.authentication.AuthenticationManager"\r
                context-class-loader="client" />\r
 </beans:beans>
\ No newline at end of file
index 9e357a36d5af331af439e1b88d0ae2c432e72393..916c2c69202af2143f767746d31bc4905621b94b 100644 (file)
@@ -9,6 +9,6 @@
        osgi:default-timeout="30000">\r
 \r
        <reference id="userDetailsManager"\r
-               interface="org.springframework.security.userdetails.UserDetailsManager"\r
+               interface="org.springframework.security.provisioning.UserDetailsManager"\r
                cardinality="0..1" />\r
 </beans:beans>
\ No newline at end of file
index fec44339bc84c4238ea911a1a81f8f002323edbd..eeb560743c1eabd7c51e55d7dfb3a7a73911c0d6 100644 (file)
@@ -9,8 +9,8 @@
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd">\r
 \r
        <reference id="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager" />\r
+               interface="org.springframework.security.authentication.AuthenticationManager" />\r
        <reference id="userDetailsService"\r
-               interface="org.springframework.security.userdetails.UserDetailsService"\r
+               interface="org.springframework.security.core.userdetails.UserDetailsService"\r
                cardinality="0..1" />\r
 </beans:beans>
\ No newline at end of file