42 lines
1.3 KiB
XML
42 lines
1.3 KiB
XML
|
|
<beans:beans
|
|
xmlns="http://www.springframework.org/schema/security"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xmlns:beans="http://www.springframework.org/schema/beans"
|
|
xmlns:sec="http://www.springframework.org/schema/security"
|
|
xmlns:context="http://www.springframework.org/schema/context"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/security
|
|
http://www.springframework.org/schema/security/spring-security-4.2.xsd
|
|
http://www.springframework.org/schema/context
|
|
http://www.springframework.org/schema/context/spring-context-4.2.xsd
|
|
http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
|
|
|
|
<context:component-scan base-package="security.*" />
|
|
|
|
|
|
<http use-expressions="true" create-session="stateless" auto-config='true'>
|
|
|
|
<!-- Default to Spring MVC's CORS configuration -->
|
|
<cors />
|
|
<!-- disable csrf checks -->
|
|
<csrf disabled="true"/>
|
|
|
|
<custom-filter after="BASIC_AUTH_FILTER" ref="tokenAuthenticationFilter" />
|
|
<intercept-url pattern="/**" access="isAuthenticated()" />
|
|
<http-basic/>
|
|
</http>
|
|
|
|
|
|
<authentication-manager>
|
|
<authentication-provider ref="customAuthenticationProvider" />
|
|
</authentication-manager>
|
|
|
|
|
|
<beans:bean id="tokenFilter" class="security.TokenAuthenticationFilter"/>
|
|
|
|
|
|
|
|
</beans:beans>
|