From 0327dc1ce76623d339729e27d170fc03583d2db1 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Sat, 3 Jan 2015 15:28:28 +0000 Subject: [PATCH] Adapt to changes in third parties git-svn-id: https://svn.argeo.org/commons/branches/mbaudier.2.tp@7624 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- demo/argeo_node_cms.properties | 2 +- demo/argeo_node_rap.properties | 2 +- org.argeo.cms/META-INF/spring/osgi.xml | 2 +- org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml | 4 +-- .../META-INF/spring/security-ldap-osgi.xml | 6 ++-- .../spring/security-ldap-services.xml | 6 ++-- .../core/InternalAuthenticationProvider.java | 28 +++++++++++++++++++ .../META-INF/spring/security-cli-osgi.xml | 6 ++-- .../META-INF/spring/security-cli.xml | 4 +-- .../META-INF/spring/remote.xml | 2 +- .../META-INF/spring/security-jcr-osgi.xml | 6 ++-- .../META-INF/spring/security-jcr-services.xml | 11 ++++---- .../META-INF/spring/security-ldap-osgi.xml | 6 ++-- .../spring/security-ldap-services.xml | 6 ++-- .../META-INF/spring/security-os-osgi.xml | 6 ++-- .../META-INF/spring/security-os.xml | 4 +-- .../META-INF/spring/osgi.xml | 2 +- .../META-INF/spring/osgi.xml | 2 +- org.argeo.server.rap.webapp/WEB-INF/osgi.xml | 4 +-- 19 files changed, 69 insertions(+), 40 deletions(-) create mode 100644 org.argeo.security.core/src/org/argeo/security/core/InternalAuthenticationProvider.java diff --git a/demo/argeo_node_cms.properties b/demo/argeo_node_cms.properties index d53298060..aba171da5 100644 --- a/demo/argeo_node_cms.properties +++ b/demo/argeo_node_cms.properties @@ -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,\ diff --git a/demo/argeo_node_rap.properties b/demo/argeo_node_rap.properties index c04eea2a7..8596df804 100644 --- a/demo/argeo_node_rap.properties +++ b/demo/argeo_node_rap.properties @@ -1,5 +1,5 @@ argeo.osgi.start.1.node=\ -org.springframework.osgi.extender +org.eclipse.gemini.blueprint.extender #org.argeo.server.ads.server,\ diff --git a/org.argeo.cms/META-INF/spring/osgi.xml b/org.argeo.cms/META-INF/spring/osgi.xml index 4b5178779..48609a1e4 100644 --- a/org.argeo.cms/META-INF/spring/osgi.xml +++ b/org.argeo.cms/META-INF/spring/osgi.xml @@ -11,7 +11,7 @@ filter="(argeo.jcr.repository.alias=node)" /> + interface="org.springframework.security.authentication.AuthenticationManager" /> diff --git a/org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml b/org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml index b4a3c48df..089c71559 100644 --- a/org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml +++ b/org.argeo.jackrabbit.webapp/WEB-INF/osgi.xml @@ -22,7 +22,7 @@ + interface="org.springframework.security.authentication.AuthenticationManager" /> + interface="org.springframework.security.core.userdetails.UserDetailsService" /> \ No newline at end of file diff --git a/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-osgi.xml b/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-osgi.xml index d817f9644..c03964209 100644 --- a/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-osgi.xml +++ b/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-osgi.xml @@ -12,15 +12,15 @@ - + - + diff --git a/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-services.xml b/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-services.xml index 0b9a8b8f0..6fcf77dea 100644 --- a/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-services.xml +++ b/org.argeo.security.auth.ldap/META-INF/spring/security-ldap-services.xml @@ -4,7 +4,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + @@ -35,7 +35,7 @@ + class="org.springframework.security.authentication.AnonymousAuthenticationProvider"> @@ -50,7 +50,7 @@ initialization himself, in order to prevent the following dependency cycle: Repository.login() <= AuthenticationManager <= LdapAuthenticationProvider <= Repository.login() in init() --> - + 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 index 000000000..0efabcde0 --- /dev/null +++ b/org.argeo.security.core/src/org/argeo/security/core/InternalAuthenticationProvider.java @@ -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); + } + +} diff --git a/org.argeo.security.dao.cli/META-INF/spring/security-cli-osgi.xml b/org.argeo.security.dao.cli/META-INF/spring/security-cli-osgi.xml index c46f2764c..f2bcd97b7 100644 --- a/org.argeo.security.dao.cli/META-INF/spring/security-cli-osgi.xml +++ b/org.argeo.security.dao.cli/META-INF/spring/security-cli-osgi.xml @@ -15,14 +15,14 @@ + interface="org.springframework.security.authentication.AuthenticationManager" /> diff --git a/org.argeo.security.dao.cli/META-INF/spring/security-cli.xml b/org.argeo.security.dao.cli/META-INF/spring/security-cli.xml index c3f6c8122..a9102edc8 100644 --- a/org.argeo.security.dao.cli/META-INF/spring/security-cli.xml +++ b/org.argeo.security.dao.cli/META-INF/spring/security-cli.xml @@ -23,7 +23,7 @@ - + @@ -51,7 +51,7 @@ himself, in order to prevent the following dependency cycle: Repository.login() <= AuthenticationManager <= osJcrAuthenticationProvider <= Repository.login() in init() --> - + diff --git a/org.argeo.security.dao.jackrabbit/META-INF/spring/remote.xml b/org.argeo.security.dao.jackrabbit/META-INF/spring/remote.xml index ff62a5c64..b44585dc0 100644 --- a/org.argeo.security.dao.jackrabbit/META-INF/spring/remote.xml +++ b/org.argeo.security.dao.jackrabbit/META-INF/spring/remote.xml @@ -9,7 +9,7 @@ - + diff --git a/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-osgi.xml b/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-osgi.xml index 3d3f4010f..7ca23acfa 100644 --- a/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-osgi.xml +++ b/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-osgi.xml @@ -15,13 +15,13 @@ + interface="org.springframework.security.authentication.AuthenticationManager" /> + interface="org.springframework.security.core.userdetails.UserDetailsService" /> + interface="org.springframework.security.provisioning.UserDetailsManager" /> \ No newline at end of file diff --git a/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-services.xml b/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-services.xml index 7f276a271..1923d1023 100644 --- a/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-services.xml +++ b/org.argeo.security.dao.jackrabbit/META-INF/spring/security-jcr-services.xml @@ -12,7 +12,8 @@ - + @@ -23,13 +24,12 @@ - + + class="org.springframework.security.authentication.AnonymousAuthenticationProvider"> @@ -61,7 +61,8 @@ initialization himself, in order to prevent the following dependency cycle: Repository.login() <= AuthenticationManager <= JackrabbitUserAdminService <= Repository.login() in init() --> - + diff --git a/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-osgi.xml b/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-osgi.xml index aa3b67ac6..9e6e3f24b 100644 --- a/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-osgi.xml +++ b/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-osgi.xml @@ -12,15 +12,15 @@ diff --git a/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-services.xml b/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-services.xml index 36dedf389..9a2f2d1d4 100644 --- a/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-services.xml +++ b/org.argeo.security.dao.ldap/META-INF/spring/security-ldap-services.xml @@ -4,7 +4,7 @@ xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - + @@ -35,7 +35,7 @@ + class="org.springframework.security.authentication.AnonymousAuthenticationProvider"> @@ -50,7 +50,7 @@ initialization himself, in order to prevent the following dependency cycle: Repository.login() <= AuthenticationManager <= LdapAuthenticationProvider <= Repository.login() in init() --> - + diff --git a/org.argeo.security.dao.os/META-INF/spring/security-os-osgi.xml b/org.argeo.security.dao.os/META-INF/spring/security-os-osgi.xml index 5d827b4a5..0a605c7b8 100644 --- a/org.argeo.security.dao.os/META-INF/spring/security-os-osgi.xml +++ b/org.argeo.security.dao.os/META-INF/spring/security-os-osgi.xml @@ -15,14 +15,14 @@ + interface="org.springframework.security.authentication.AuthenticationManager" /> diff --git a/org.argeo.security.dao.os/META-INF/spring/security-os.xml b/org.argeo.security.dao.os/META-INF/spring/security-os.xml index 3d94f502d..d80084dfe 100644 --- a/org.argeo.security.dao.os/META-INF/spring/security-os.xml +++ b/org.argeo.security.dao.os/META-INF/spring/security-os.xml @@ -23,7 +23,7 @@ - + @@ -51,7 +51,7 @@ himself, in order to prevent the following dependency cycle: Repository.login() <= AuthenticationManager <= osJcrAuthenticationProvider <= Repository.login() in init() --> - + diff --git a/org.argeo.security.equinox/META-INF/spring/osgi.xml b/org.argeo.security.equinox/META-INF/spring/osgi.xml index 9e411ea00..17ece3a08 100644 --- a/org.argeo.security.equinox/META-INF/spring/osgi.xml +++ b/org.argeo.security.equinox/META-INF/spring/osgi.xml @@ -9,6 +9,6 @@ osgi:default-timeout="30000"> \ No newline at end of file diff --git a/org.argeo.security.ui.rap/META-INF/spring/osgi.xml b/org.argeo.security.ui.rap/META-INF/spring/osgi.xml index 9e357a36d..916c2c692 100644 --- a/org.argeo.security.ui.rap/META-INF/spring/osgi.xml +++ b/org.argeo.security.ui.rap/META-INF/spring/osgi.xml @@ -9,6 +9,6 @@ osgi:default-timeout="30000"> \ No newline at end of file diff --git a/org.argeo.server.rap.webapp/WEB-INF/osgi.xml b/org.argeo.server.rap.webapp/WEB-INF/osgi.xml index fec44339b..eeb560743 100644 --- a/org.argeo.server.rap.webapp/WEB-INF/osgi.xml +++ b/org.argeo.server.rap.webapp/WEB-INF/osgi.xml @@ -9,8 +9,8 @@ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd"> + interface="org.springframework.security.authentication.AuthenticationManager" /> \ No newline at end of file -- 2.30.2