Repository: cxf Updated Branches: refs/heads/master da6b2ee8c -> 0bc9bb32b
Patch from vantonevich to get jax_rs/spring_security demo updated applied; This closes #30 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bf6bba10 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bf6bba10 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bf6bba10 Branch: refs/heads/master Commit: bf6bba1082d030298df9b9f1c354da5f92833eae Parents: b6d68bf Author: Sergey Beryozkin <[email protected]> Authored: Mon Nov 17 22:04:23 2014 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Mon Nov 17 22:04:23 2014 +0100 ---------------------------------------------------------------------- .../release/samples/jax_rs/spring_security/pom.xml | 9 ++++++++- .../demo/jaxrs/service/CustomerServiceSecured.java | 2 +- .../src/main/webapp/WEB-INF/beans.xml | 16 +++++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/bf6bba10/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml b/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml index 0cb8a1a..da1afb0 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_security/pom.xml @@ -32,6 +32,7 @@ <properties> <cxf.version>${project.version}</cxf.version> <aspectj.version>1.5.4</aspectj.version> + <spring.security.version>3.2.5.RELEASE</spring.security.version> </properties> <build> <finalName>JAXRSSpringSecurity</finalName> @@ -129,9 +130,15 @@ <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> + <dependency> + <groupId>org.springframework.security</groupId> + <artifactId>spring-security-config</artifactId> + <version>${spring.security.version}</version> + </dependency> <dependency> <groupId>org.springframework.security</groupId> - <artifactId>spring-security-core-tiger</artifactId> + <artifactId>spring-security-web</artifactId> + <version>${spring.security.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> http://git-wip-us.apache.org/repos/asf/cxf/blob/bf6bba10/distribution/src/main/release/samples/jax_rs/spring_security/src/main/java/demo/jaxrs/service/CustomerServiceSecured.java ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/java/demo/jaxrs/service/CustomerServiceSecured.java b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/java/demo/jaxrs/service/CustomerServiceSecured.java index 56bab23..699a448 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/java/demo/jaxrs/service/CustomerServiceSecured.java +++ b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/java/demo/jaxrs/service/CustomerServiceSecured.java @@ -19,7 +19,7 @@ package demo.jaxrs.service; import javax.ws.rs.core.Response; -import org.springframework.security.annotation.Secured; +import org.springframework.security.access.annotation.Secured; public interface CustomerServiceSecured { http://git-wip-us.apache.org/repos/asf/cxf/blob/bf6bba10/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml ---------------------------------------------------------------------- diff --git a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml index 0b7afa6..2dab694 100644 --- a/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml +++ b/distribution/src/main/release/samples/jax_rs/spring_security/src/main/webapp/WEB-INF/beans.xml @@ -17,7 +17,7 @@ specific language governing permissions and limitations under the License. --> -<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml"/> <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/> <jaxrs:server id="bookservice" address="/"> @@ -29,23 +29,25 @@ </jaxrs:providers> </jaxrs:server> <bean id="customerservice" class="demo.jaxrs.service.CustomerServiceImpl"/> - <!-- - <bean id="customerservice" class="demo.jaxrs.service.CustomerServiceSecuredImpl"/> +<!-- + <bean id="customerservice" class="demo.jaxrs.service.CustomerServiceSecuredImpl"/> --> <security:global-method-security secured-annotations="enabled"> - <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.getCustomer(*))" access="ROLE_CUSTOMER, ROLE_ADMIN"/> + <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.getCustomer(*))" access="ROLE_CUSTOMER,ROLE_ADMIN"/> <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.addCustomer(*))" access="ROLE_ADMIN"/> <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.updateCustomer(Long,demo.jaxrs.service.Customer))" access="ROLE_ADMIN"/> <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.deleteCustomer(*))" access="ROLE_ADMIN"/> - <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.getOrder(*))" access="ROLE_CUSTOMER, ROLE_ADMIN"/> + <security:protect-pointcut expression="execution(* demo.jaxrs.service.CustomerService.getOrder(*))" access="ROLE_CUSTOMER,ROLE_ADMIN"/> </security:global-method-security> <security:http auto-config="true"> <security:http-basic/> </security:http> - <security:authentication-provider> + <security:authentication-manager> + <security:authentication-provider> <security:user-service> <security:user name="bob" password="bobspassword" authorities="ROLE_CUSTOMER"/> <security:user name="fred" password="fredspassword" authorities="ROLE_CUSTOMER, ROLE_ADMIN"/> </security:user-service> - </security:authentication-provider> + </security:authentication-provider> + </security:authentication-manager> </beans>
