52 lines
2.1 KiB
XML
52 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<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:p="http://www.springframework.org/schema/p"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/security
|
|
http://www.springframework.org/schema/security/spring-security.xsd
|
|
http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
|
|
|
<!-- Spring Security Configurations are managed in SecurityJavaConfig class -->
|
|
<!--
|
|
<http use-expressions="true" entry-point-ref="restAuthenticationEntryPoint">
|
|
<intercept-url pattern="/admin/*" access="hasAnyRole('ROLE_ADMIN')"/>
|
|
|
|
<intercept-url pattern="/api/**" access="isAuthenticated()" />
|
|
|
|
<csrf disabled="true" />
|
|
|
|
<form-login authentication-success-handler-ref="mySuccessHandler"
|
|
authentication-failure-handler-ref="myFailureHandler" />
|
|
|
|
|
|
<access-denied-handler error-page="/my-error-page" />
|
|
|
|
<access-denied-handler ref="customAccessDeniedHandler" />
|
|
|
|
<logout />
|
|
</http>
|
|
|
|
<beans:bean id="mySuccessHandler"
|
|
class="com.baeldung.security.MySavedRequestAwareAuthenticationSuccessHandler" />
|
|
<beans:bean id="myFailureHandler"
|
|
class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler" />
|
|
<bean name="encoder"
|
|
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"/>
|
|
|
|
<authentication-manager alias="authenticationManager">
|
|
<authentication-provider>
|
|
<user-service>
|
|
<user name="temporary" password="temporary" authorities="ROLE_ADMIN" />
|
|
<user name="user" password="userPass" authorities="ROLE_USER" />
|
|
<user name="user1" password="user1Pass" authorities="ROLE_USER"/>
|
|
<user name="admin" password="adminPass" authorities="ROLE_ADMIN"/>
|
|
</user-service>
|
|
</authentication-provider>
|
|
</authentication-manager>
|
|
|
|
<global-method-security pre-post-annotations="enabled"/>
|
|
-->
|
|
</beans:beans> |