Security Spring Configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">

 

<! - page blocking rules ->
<HTTP-use Expressions = "false">
<! - blocking all paths, set access permissions access this path only users with permission before they can release ROLE_USER ->
<url-Intercept = pattern "/ **" Access = "ROLE_USER" />
<- the Login-page:! specify the login page, default-target-url: Specifies the default page after a successful login, authentication-failure-url: Login failed jump the page ->
<form-the Login-the Login page = "/ login.html" default-target-url = "/ index.html" authentication-failure-url = "/ login_error.html" />
<-! disabled csrf authentication, the domain access system may be provided -.>
<csrf = Disabled "to true" />
</ HTTP>


<!-- 认证管理器 -->
<authentication-manager>
<authentication-provider>
<user-service>
<user name="admin" password="123456" authorities="ROLE_USER"/>
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>

Guess you like

Origin www.cnblogs.com/lijun6/p/11853968.html