Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <beans>
- <import resource="classpath:META-INF/cxf/cxf.xml"/>
- <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml"/>
- <import resource="classpath:META-INF/cxf/cxf-extension-http.xml"/>
- <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>
- <jaxrs:server id="serverTest" address="/test">
- <jaxrs:serviceBeans>
- <ref bean="tstSvr"/>
- </jaxrs:serviceBeans>
- </jaxrs:server>
- <bean id="tstSvr" class="com.demo.Test"/>
- <security:http auto-config="true">
- <security:intercept-url pattern="/admin/**" access="ROLE_ADMIN" method="PUT" />
- <security:intercept-url pattern="/**" access="ROLE_USER" />
- </security:http>
- <security:authentication-manager>
- <security:authentication-provider>
- <security:user-service>
- <security:user name="user" password="pass" authorities="ROLE_USER"/>
- <security:user name="admin" password="pass" authorities="ROLE_ADMIN"/>
- </security:user-service>
- </security:authentication-provider>
- </security:authentication-manager>
- </beans>
- <web-app>
- <filter>
- <filter-name>springSecurityFilterChain</filter-name>
- <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
- </filter>
- <filter-mapping>
- <filter-name>springSecurityFilterChain</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- </web-app>
- Caused by: org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
- at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:323)
- at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:196)
- at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:59)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[46:org.springframework.aop:3.0.5.RELEASE]
Add Comment
Please, Sign In to add comment