码迷,mamicode.com
首页 > 编程语言 > 详细

Security Spring 配置

时间:2019-11-13 23:46:39      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:默认   word   org   登录失败   跨域访问   跨域   min   规则   style   

<?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">

 

<!-- 页面拦截规则 -->
<http use-expressions="false">
<!--拦截所有路径, access设置访问这个路径的权限 只有用户拥有ROLE_USER权限才可以放行-->
<intercept-url pattern="/**" access="ROLE_USER" />
<!-- login-page:指定登录页面, default-target-url:指定登录成功后默认的页面, authentication-failure-url:登录失败跳转的页面 -->
<form-login login-page="/login.html" default-target-url="/index.html" authentication-failure-url="/login_error.html"/>
<!-- 禁用csrf认证, 设置后系统可以进行跨域访问. -->
<csrf disabled="true"/>
</http>


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

Security Spring 配置

标签:默认   word   org   登录失败   跨域访问   跨域   min   规则   style   

原文地址:https://www.cnblogs.com/lijun6/p/11853968.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!