第 1 章 一个简单的HelloWorld

第 1 章 一个简单的HelloWorld

Spring Security中可以使用Acegi-1.x时代的普通配置方式,也可以使用从2.0时代才出现的命名空间配置方式,实际上这两者实现的功能是完全一致的,只是新的命名空间配置方式可以把原来需要几百行的配置压缩成短短的几十行。我们的教程中都会使用命名空间的方式进行配置,凡事务求最简。

1.1. 配置过滤器

为了在项目中使用Spring Security控制权限,首先要在web.xml中配置过滤器,这样我们就可以控制对这个项目的每个请求了。

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

所有的用户在访问项目之前,都要先通过Spring Security的检测,这从第一时间把没有授权的请求排除在系统之外,保证系统资源的安全。关于过滤器配置的更多讲解可以参考http://www.family168.com/tutorial/jsp/html/jsp-ch-07.html#jsp-ch-07-03-01

1.2. 使用命名空间

在applicationContext.xml中使用Spring Security提供的命名空间进行配置。

spring 2.0的旧的命名空间

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"1
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-2.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> <http auto-config='true'>2
<intercept-url pattern="/admin.jsp" access="ROLE_ADMIN" />3
<intercept-url pattern="/**" access="ROLE_USER" />
</http> <authentication-provider>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />4
<user name="user" password="user" authorities="ROLE_USER" />
</user-service>
</authentication-provider> </beans:beans>

使用spring securety3.0以上的命名空间

<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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd"> <http auto-config="true">2
<intercept-url pattern="/admin.jsp" access="ROLE_ADMIN" />3
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login/>
</http> <authentication-provider>
<user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />4
<user name="user" password="user" authorities="ROLE_USER" />
</user-service>
</authentication-provider> </beans:beans>

声明在xml中使用Spring Security提供的命名空间。

http部分配置如何拦截用户请求。auto-config='true'将自动配置几种常用的权限控制机制,包括form, anonymous, rememberMe。

我们利用intercept-url来判断用户需要具有何种权限才能访问对应的url资源,可以在pattern中指定一个特定的url资源,也可以使用通配符指定一组类似的url资源。例子中定义的两个intercepter-url,第一个用来控制对/admin.jsp的访问,第二个使用了通配符/**,说明它将控制对系统中所有url资源的访问。

在实际使用中,Spring Security采用的是一种就近原则,就是说当用户访问的url资源满足多个intercepter-url时,系统将使用第一个符合条件的intercept-url进行权限控制。在我们这个例子中就是,当用户访问/admin.jsp时,虽然两个intercept-url都满足要求,但因为第一个intercept-url排在上面,所以Spring Security会使用第一个intercept-url中的配置处理对/admin.jsp的请求,也就是说,只有那些拥有了ROLE_ADMIN权限的用户才能访问/admin.jsp。

access指定的权限部分比较有趣,大家可以注意到这些权限标示符都是以ROLE_开头的,实际上这与Spring Security中的Voter机制有着千丝万缕的联系,只有包含了特定前缀的字符串才会被Spring Security处理。目前来说我们只需要记住这一点就可以了,在教程以后的部分中我们会详细讲解Voter的内容。

user-service中定义了两个用户,admin和user。为了简便起见,我们使用明文定义了两个用户对应的密码,这只是为了当前演示的方便,之后的例子中我们会使用Spring Security提供的加密方式,避免用户密码被他人窃取。

最最重要的部分是authorities,这里定义了这个用户登陆之后将会拥有的权限,它与上面intercept-url中定义的权限内容一一对应。每个用户可以同时拥有多个权限,例子中的admin用户就拥有ROLE_ADMIN和ROLE_USER两种权限,这使得admin用户在登陆之后可以访问ROLE_ADMIN和ROLE_USER允许访问的所有资源。

与之对应的是,user用户就只拥有ROLE_USER权限,所以他只能访问ROLE_USER允许访问的资源,而不能访问ROLE_ADMIN允许访问的资源

1.3. 完善整个项目

因为Spring Security是建立在Spring的基础之上的,所以web.xml中除了需要配置我们刚刚提到的过滤器,还要加上加载Spring的相关配置。最终得到的web.xml看起来像是这样:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>spring_security_1</display-name> <context-param>
<param-name>contextConfigLocation</param-name>
<!-- 应用上下文配置文件 -->
<!-- 两种位置写法 -->
<!-- springMvc和spring security 两个配置文件 -->
<!-- <param-value>/WEB-INF/spring-servlet.xml</param-value> -->
<param-value>classpath:spring-servlet2.xml,classpath:applicationContext-security.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- spring securit start -->
<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>
<!-- spring securit start --> <!-- 配置spring核心servlet -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet> <!-- url-pattern配置为/ 拦截 -->
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> </web-app>

演示不同权限的用户登陆之后可以访问不同的资源,我们为项目添加了两个jsp文件,admin.jsp和index.jsp。其中admin.jsp只有那些拥有ROLE_ADMIN权限的用户才能访问,而index.jsp只允许那些拥有ROLE_USER权限的用户才能访问。

最终我们的整个项目会变成下面这样:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUwAAAGlCAIAAAAeR1hCAAAgAElEQVR4nO2d61sUV6Kv+R/2t/k4zznGjMnkGJOB9EnU4DUZI8bMZHSyczNn98StM5ntXVEJKNiihlJEdLzEoBIExHsnatAYBY1iYoyioVEuEoGmuwXkUoBOnQ/Vl1VVq6qrm6qu6urf+9STp7t6rarVhrfXqsv6VRIHALAuzm9qkoxuAwBARyA5ABYHkgNgcTSWfNf+w496esk1rb5H76w7rOEuAAARMSzJR87ZNiPjIMdxMzIOjpyzjeO4O7eu5+/YR5Zp6eiesGQfvT4AQH+GK/nIOdvm5X/Fv+A4zn1h1Y71yxevzF28MjdrXX6726u95C7GlmRjXFpuUmPM30KQSAxX8rTVB/n+nJec6/rOvzzpfzLU9/BhFySPora5vx6IM4Yr+cFva0fO2VZx8bZfct8Z/8Jx/KF4Yg/XXYwtye6MqHhSUpLJf8NAnKH12XX3Uf/y7ycTluw7VXM358uLH248puUu4omIJPcPAJx2SA60JIzk586dczgccp/OW/QF92sxvzy5f+DM4f2fri35ZOG+Txbuq73967FLdeMXFk1eduD7O79WHP1RWj3QbyUl+UXglXDahWsF622MKySO055kYxh/cUKM4BZsDCNrjGTvZEXq1pJsjEugbeg1tYWhikk2u50cwSt6DMmBtihJXllZOWrUqBEjRsgVeNe+l2vaxTXt6q/bvSqrJP/IraNNT/jlRPMTL/tvvlhte//fFhwSV6Z0crx3gZVOOym/WPlACaIIr0aomr8i1RjK3km5gh877aINyEtOayFRmti8067UvUNyoC2ykvOGz5o1S0Hyy1ebHrlO+67tHfDWX6l7WHp7QLrsvOD5r0XO+792SXdtFx9+iswLvhWuF/XkIS1tjEuiiKwxkr0T/W6o35ZWV+rJpWXI9cFtKTsOyYHG0CUPGj579mwFyQceeZtK3ultKGkue58dGNh/raeoRrDk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完成后。打开浏览器访问http://localhost:8080/spring_security_1/就可以看到登陆页面。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfEAAAC+CAIAAACqKaEnAAARL0lEQVR4nO3dT2gcV4LH8Xergw6iD80chDFGBB/EUgbrIGKWIB18CYgYBszIavZgZnCG1UWQDegQ21nEUAx4mbEWxC4jFhQnK0YDTTSesCYCsyZ2JokNJg0aTIyxNbPb49ntnUMf6lZ7ePXnvVevWq3qltT18v2gg1R/X9V7/avXr6rV4q8AAFeIky4AAGBoyHQAcIf4TwCAK0QEAHAFmQ4A7iDTAcAdZDoAuINMBwB3kOkA4A4yHQDcQaYDgDvIdABwB5kOAO4g0wHAHWQ6ALiDTAcAd4xCpodP19+e8IQ3/tatp+Gx7bV9b/lvxoQYO3Ot2e61XCvwhRBCCD9oHVfZMBzUXU+cHif1zPRmQ1a5aDSPsgxp0xJj1/7jKHekSQ9OvHn7eT+lO0zDL14pO9ijPamI+qm7rDpS3vjE1Nzyxlf7x9e/OCFkupNGIdOj1q9OoJ/e2X3f7KeHnW93//mD+ZmJt25lbZxMr65SmZ6oX/yV40lHpjtpJDJ9VFjbOJleXQNluhDepU86x1vg40WmO4lMV5DpjjlMpsfV0X39ZONSPUn1y9suD8CQ6U4aMNO7ezvB4szEuCf7NeMTM4vBzl5XWyZ8tr0898a4J4QYO/NO8KCda0rmfrQF2g+Cd86MCSG88TfeCR5Y72c+X7sgVzi18iiduLtUMyc+XZ0SQghRW9o1GrS1v6bPMQpzfnHjcddWmNwR2OcoJzXc/2pjeW6qPiZnjNWn5n75tXKOt5LzJ7zxN+aWt7ITrJy58Nnm4pkxIbyrd/UzGj7bvnZenv76zLXtZ6G62w/mZ05PJNuemFlcU06wtpH9+/LIvfHz8TbC/d8tz9TtJyPcv7+2OBMf0Fh9ZnHtfo/h6UMVpOhoIq2leePnl+/lW1pxRaltvLM5r7aAqLu3E/xkbup0ejxTc8v6nvOvg7//7ase857fezdunPOb6VuBV+uzwpgYbl+WU2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4Y4xMf0j/4ttgzZkOgCo+s309gHuLAj/xkN9gli4Y/xhTpSr5H+xbdCGTAcA1ZFlevvOgkgmZVGuhHo2n0wHgOEYYqarFu602+2HN/z4TyWd0wUXFuinA8Bw9Zvp/z18Hy0I/8YXA22CTAcAVb+Z/l9DsvmjH20mvwn/+heDbY1MBwDV8Wd6Oj6ThPsAyHQAUPWb6X8aSWQ6AKjIdABwR7+ZPrKO+gQBQIX0lekAgEog0wHAHWQ6ALiDTAcAd5DpAOAOMh0A3EGmA4A7yHQAcAeZDgDuINMBwB1kOgC4g0wHAHeQ6QDgDjIdANxBpgOAO8h0AHAHmQ4A7iDTAcAdZDoAuINMBwB3kOkA4A4yHQDcQaYDgDvIdABwB5kOAO4g0wHAHWQ6ALiDTAcAd5DpAOAOMh0A3EGmA4A7yHQAcAeZDgDuINMBwB1kOgC4g0wHAHeQ6QDgDjIdANxBpgOAO8h0AHAHmQ4A7iDTAcAdZDoAuINMBwB3kOkA4A4yHQDcQaYDgDvIdABwB5kOAO4g0wHAHWQ6ALiDTAcAd5DpAOCO/wdrgmQrFe+Q2AAAAABJRU5ErkJggg==" alt="" />

这个简陋的页面是Spring Security自动生成的,一来为了演示的方便,二来避免用户自己编写登陆页面时犯错,Spring Security为了避免可能出现的风险,连测试用的登录页面都自动生成出来了。在这里我们就省去编写登陆页面的步骤,直接使用默认生成的登录页面进行演示吧。

如果输入的是正确的用户名和密码,比如user/user,系统在登陆成功后会默认跳转到index.jsp。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXAAAACeCAIAAACkQsYuAAAXH0lEQVR4nO2d6W8bR5qH+78xECjQh8UCO9hZYLEYYHdmPLMDTyZhMmBmd5OZIMkm8G4msz5ij2jHUeh4YhtO5BySkvigj9A05YPUQVkipZiULYqSSFHUYeqKJVIHySapyzKg/dBks7q7utkSS6Zk/x70B3axurrYrHr4vtVtmVsEAABGcPqr8jwfi8WGhoa6u7t9Pp/b7Xa73T6fLxAIDITDsVhs63oJAN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IBQDADAgFAMAMCAUAwAwIBQDADAgFAMAMCAUAwAwIBQDADAgFAMAMCAUAwAwIBQDADAgFAMAMCAUAwAwIBQDADAgFAMAMCAUAwIz/BztTfzV4xl6SAAAAAElFTkSuQmCC" alt="" />

index。jsp的页面

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录首页</title>
</head>
<body>
<span color="red">登录成功!</span>
</body>
</html>

直接打开http://localhost:8080/spring_security_1/admin.jsp

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAg0AAADzCAIAAACKfbKDAAAgAElEQVR4nO3da3ATV6In8P7mD3yg/MG1H6hUKkVN5QPeUqrCVnEn99Ys1FZ2701dNtmbGRyCc/cu80gy16lZ5maScRKwkiGMMhmYLAxhJuBkAggIwpEx2OAH+EGQCH4Alp+AHzjYso1lyRYgA1W9H/p1zunTR21JbVnO/1f6YLf6cfp1/n3OaYN0FwAAwJqU7QIAAMCihpwAAACReeRELBYLh8N9fX2tra3BYLCpqampqSkYDHZ0dHR1d4fDYedKCQAA2WIrJ2KxWFd3d1NTU2trW19//1h4fGJyMjYzE5uZmZic/O727YGBgdbWtoaGc13d3U6XGAAAFlKSnIjFYn19fd98801Xd8/E5OTde/cEn9jMTFd3D9ICAGApEeVELBbr6OhobW0bn5gQJwT5iUxPX7lyNRgMxmKxBdsNAABwiBS3MDEx0dJyoau7Zzoajd+9O99PX3//+fPnT9c3N1y4jA8++OCDT+5++DkRjUYDgcDQ0HAKCaF/RsfCzc3NiUTiEQAA5CxOv5PS3dTV3WO/r8nqMzAwcPnyZRkAAHIWpz3R29vb0XElMj2dTmNC/3R0XBkcHMx4uScnJzO+TgAAMGNzIhqNXrhwYSwctpMBF4OXgt+2iueZjkabmpoSiURmyx0KhTK7QgAA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MObZRcZd+ktQrkBACA0+zmxGiGHHzppYPaT5Jr2zfprQ05AQDgtIXPCb1vSguMNCAnAACcZjcnbi9KyAkAAKchJwAAQMRuTixaTh8gAIDvOVs5AQAA31vICQAAEEFOAACACHICAABEkBMAACCCnAAAABHkBAAAiCAnAABABDkBAAAiyAkAABBBTgAAgAhyAgAARJATAAAggpwAAAAR5AQAAIggJwAAQAQ5AQAAIsgJAAAQQU4AAIAIcgIAAESQEwAAIIKcAAAAEeQEAACIICcAAEAEOQEAACLICQAAEEFOAACACHICAABEkBMAACCCnAAAABHkBAAAiCAnAABABDkBAAAiyAkAABBBTgAAgAhyAgAARJATAAAggpwAAAAR5AQAAIggJwAAQAQ5AQAAIsgJAAAQQU4AAIAIcgIAAESQEwAAIIKcAAAAkf8PTkvhe6jZZTQAAAAASUVORK5CYII=" alt="" />

很遗憾,user用户是无法访问/admin.jsp这个url资源的,这在上面的配置文件中已经有过深入的讨论。我们在这里再简要重复一遍:user用户拥有ROLE_USER权限,但是/admin.jsp资源需要用户拥有ROLE_ADMIN权限才能访问,所以当user用户视图访问被保护的/admin.jsp时,Spring Security会在中途拦截这一请求,返回拒绝访问页面。

为了正常访问admin.jsp,使用admin/admin登陆系统,然后再次点击admin.jsp链接就会显示出admin.jsp中的内容。

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZQAAACvCAIAAABVbb8tAAAYpUlEQVR4nO2d/W8bx52H+d8YCBQIOOOAK9oDDocD7tqmvcJNEyaF0rtL2iDpJfAlbc+OY9e04zhy0tQ+J0qcSFUS2/RLaIXyi6gXyhYpxaRsUZRESqJeIlNSLJGiRHJJ6s0ywPthyd2Z2dnl6s3SyJ8H8wO5nJ2dnZ199juzI9syDwAAAmLZ6goAAMBaWIW8JEmKxWJDQ0NdXV1+v9/j8Xg8Hr/fHwwG+wcGYrHY5tUSAAAYTMlLkqT+gQGPx9PVFRgaHp6OxWcSCSmTkTKZmUTi+/v3x8bGuroCra03+wcGNrvGAAAwX1Jeki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sgLACAkkBcAQEggLwCAkEBeAAAhgbwAAEICeQEAhATyAgAICeQFABASyAsAICSQFwBASCAvAICQQF4AACGBvAAAQgJ5AQCEBPICAAgJ5AUAEBLICwAgJJAXAEBIIC8AgJBAXgAAIYG8AABCAnkBAIQE8gIACAnkBQAQEsgLACAkkBcAQEggLwCAkEBeAAAhgbwAAEICeQEAhATyAgAICeQFABASyAsAICSQFwBASCAvAICQQF4AACGBvAAAQgJ5AQCEBPICAAgJ5AUAEBLICwAgJJAXAEBIIC8AgJBAXgAAIYG8AABCAnkBAIQE8gIACAnkBQAQEsgLACAkkBcAQEggLwCAkEBeAAAhgbwAAEICeQEAhATyAgAICeQFABASyAsAICSQFwBASCAvAICQQF4AACGBvAAAQgJ5AQCEBPICAAgJ5AUAEBLICwAgJJAXAEBIIC8AgJBAXgAAIYG8AABCAnkBAIQE8gIACMn/A2h4Qfvj/du2AAAAAElFTkSuQmCC" alt="" />

根据我们之前的配置,admin用户拥有ROLE_ADMIN和ROLE_USER两个权限,因为他拥有ROLE_USER权限,所以可以访问/index.jsp,因为他拥有ROLE_ADMIN权限,所以他可以访问/admin.jsp。

至此,我们很高兴的宣布,咱们已经正式完成,并运行演示了一个最简单的由Spring Security保护的web系统,下一步我们会深入讨论Spring Security为我们提供的其他保护功能,多姿多彩的特性。


第 2 章 使用数据库管理用户权限

上一章节中,我们把用户信息和权限信息放到了xml文件中,这是为了演示如何使用最小的配置就可以使用Spring Security,而实际开发中,用户信息和权限信息通常是被保存在数据库中的,为此Spring Security提供了通过数据库获得用户权限信息的方式。

2.1. 修改配置文件

为了从数据库中获取用户权限信息,我们所需要的仅仅是修改配置文件中的authentication-provider部分。

将上一章配置文件中的user-service替换为jdbc-user-service,替换内容如下所示:

  <authentication-provider>
<jdbc-user-service data-source-ref="dataSource"/>
<!-- <user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="user" password="user" authorities="ROLE_USER" />
</user-service> -->
</authentication-provider>

现在只要再为jdbc-user-service提供一个dataSource就可以让Spring Security使用数据库中的权限信息了。在此我们使用spring创建一个演示用的dataSource实现,这个dataSource会连接到mysql数据库,从中获取用户权限信息。[1]

 <beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<beans:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<beans:property name="url" value="jdbc:mysql://localhost/spring_security?useUnicode=true&amp;characterEncoding=utf-8"/>
<beans:property name="username" value="cqyusp_dev"/>
<beans:property name="password" value="cqyusp_dev"/>
</beans:bean>

最终的配置文件如下所示:

<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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd"> <http auto-config="true">
<intercept-url pattern="/admin.jsp" access="ROLE_ADMIN" />
<intercept-url pattern="/**" access="ROLE_USER" />
<form-login/>
</http> <authentication-manager>
<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"/>
<!-- <user-service>
<user name="admin" password="admin" authorities="ROLE_USER, ROLE_ADMIN" />
<user name="user" password="user" authorities="ROLE_USER" />
</user-service> -->
</authentication-provider>
</authentication-manager> <beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<beans:property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<beans:property name="url" value="jdbc:mysql://localhost/spring_security?useUnicode=true&amp;characterEncoding=utf-8"/>
<beans:property name="username" value="cqyusp_dev"/>
<beans:property name="password" value="cqyusp_dev"/>
</beans:bean> </beans:beans>

2.2. 数据库表结构

Spring Security默认情况下需要两张表,用户表和权限表。以下是mysql中的建表语句

CREATE TABLE users(
username VARCHAR(50) NOT NULL PRIMARY KEY,
PASSWORD VARCHAR(50) NOT NULL,
enabled BOOLEAN NOT NULL
); CREATE TABLE authorities (
username VARCHAR(50) NOT NULL,
authority VARCHAR(50) NOT NULL,
CONSTRAINT fk_authorities_users FOREIGN KEY(username) REFERENCES users(username)
); CREATE UNIQUE INDEX ix_auth_username ON authorities (username,authority); INSERT INTO users(username,PASSWORD,enabled) VALUES('admin','admin',TRUE);
INSERT INTO users(username,PASSWORD,enabled) VALUES('user','user',TRUE); INSERT INTO authorities(username,authority) VALUES('admin','ROLE_ADMIN');
INSERT INTO authorities(username,authority) VALUES('admin','ROLE_USER');
INSERT INTO authorities(username,authority) VALUES('user','ROLE_USER');

users:用户表。包含username用户登录名,password登陆密码,enabled用户是否被禁用三个字段。

其中username用户登录名为主键。

authorities:权限表。包含username用户登录名,authorities对应权限两个字段。

其中username字段与users用户表的主键使用外键关联。

对authorities权限表的username和authority创建唯一索引,提高查询效率。

Spring Security会在初始化时,从这两张表中获得用户信息和对应权限,将这些信息保存到缓存中。其中users表中的登录名和密码用来控制用户的登录,而权限表中的信息用来控制用户登陆后是否有权限访问受保护的系统资源。

上述sql中,我们创建了两个用户admin和user,其中admin拥有ROLE_ADMIN和ROLE_USER权限,而user只拥有ROLE_USER权限。这和我们上一章中的配置相同,因此本章实例的效果也和上一章完全相同,这里就不再赘述了

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAApoAAAEWCAIAAABJ9KCWAAAgAElEQVR4nO29aVgUaZqvH93nw5xxrv/pOTPnP9PTc2b6VJ+u6q7qsrq1Wrr2Uru6qqye7q6lW0XTBRQoFQQBFQUEZBO3AhVF2RSrFNOFUhGVRQRkSSDZFwFREmWTHXElIc6HhCCILQPIJCIjf/f1XF5BxPtGxBuYcfNERsRDvPr230gAgAhefftvjOgzNSRJiv8XAAAoCJPrXK/Xd3V11dTU5OXl5eTkaLXaO3fudHZ2Dg0NmXZDAMwwM6BzuBwAMDVMrPMXL140NDTkFxTU1ze0trZ29fTevnuvpLo2+9atGzduPH782ITbAmCGQXYOAJAtJtZ5XV29RltSW1//oKWlu6enraOj8nbdtVv5KXmFF6+knDt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qAzgEAssWy653zfU3OnsnuxbcUAD6gcwCAbFFCvXO2nvnuesODamA6QOcAANmikHrnjGmB/Bu3woEpA50DAGSLZdc7Hx0D1yPm9H+FMeXggaKBzgEAskUJ9c7ZGTnJujNOuC8AYoDOAQCyRfoCqah3DiwF6BwAIFuk1zmJeufAQoDOAQCyBfXOARALdA4AkC1SV1RDvXNgOUDnAADZIrXOp13vnGJSt7yJfwCdryVuj7dCoHMAgGyRXufTr3duYJo6NzqTYW48vG6FQOcAANminHrnAs+UM55Yoy81amK+vwOgcysEOgcAyBZF1TsXv1TA5cKvmmH/TYCL7dYDdA4AkC1Kq3fOmZoz0nF2MwEr860HWCHQOQBAtiik3rnwHHYubtTcwqsikZ1bJdA5AEC2KKfeOX0Ouw0pIs/mu6jO2JbRPwuAUoHOAQCyRTn1ztlX0RlKpjejz2esjTHN1jnfUqB4oHMAgGxRWr1z9o/klLJz9kyBlUDqVgJ0DgCQLUqrd87+kWTl5WKyc5LkuLQuZltAwUDnAADZoqh655w/kuKyc0abKW8LKBjoHAAgW5RT75ya5tM5+0fh+92ErS/QBigV6BwAIFukL5CKeufAUoDOAQCyRXqdk6h3DiwE6BwAIFtQ7xwAsUDnAADZInVFNdQ7B5YDdA4AkC1S63za9c4570oTfoKcxB3pYEpA5wAA2SK9zk1V75xC+EE1kQ+kAcAGOgcAyBaLr3cuMEfgGXHoHEwB6BwAIFv+H3u8WbHs5UMRAAAAAElFTkSuQmCC" alt="" />

使用user/user1登录,成功!

[1] javax.sql.DataSource是一个用来定义数据库连接池的统一接口。当我们想调用任何实现了javax.sql.DataSource接口的连接池,只需要调用接口提供的getConnection()就可以获得连接池中的jdbc连接。javax.sql.DataSource可以屏蔽连接池的不同实现,我们使用的连接池即可能由第三方包单独提供,也可能是由j2ee容器统一管理提供的。

第 3 章 自定义数据库表结构

Spring Security默认提供的表结构太过简单了,其实就算默认提供的表结构很复杂,也无法满足所有企业内部对用户信息和权限信息管理的要求。基本上每个企业内部都有一套自己的用户信息管理结构,同时也会有一套对应的权限信息体系,如何让Spring Security在这些已有的数据结构之上运行呢?

3.1. 自定义表结构

假设我们实际使用的表结构如下所示:

-- 角色
CREATE TABLE role(
id BIGINT,
NAME VARCHAR(50),
descn VARCHAR(200)
);
ALTER TABLE role ADD CONSTRAINT pk_role PRIMARY KEY(id);
ALTER TABLE role MODIFY id BIGINT AUTO_INCREMENT; -- 用户
CREATE TABLE USER(
id BIGINT,
username VARCHAR(50),
PASSWORD VARCHAR(50),
STATUS INTEGER,
descn VARCHAR(200)
);
ALTER TABLE USER ADD CONSTRAINT pk_user PRIMARY KEY(id);
ALTER TABLE USER MODIFY id BIGINT AUTO_INCREMENT; -- 用户角色连接表
CREATE TABLE user_role(
user_id BIGINT,
role_id BIGINT
);
ALTER TABLE user_role ADD CONSTRAINT pk_user_role PRIMARY KEY(user_id, role_id);
ALTER TABLE user_role ADD CONSTRAINT fk_user_role_user FOREIGN KEY(user_id) REFERENCES USER(id);
ALTER TABLE user_role ADD CONSTRAINT fk_user_role_role FOREIGN KEY(role_id) REFERENCES role(id); INSERT INTO USER(id,username,PASSWORD,STATUS,descn) VALUES(1,'admin','admin',1,'管理员');
INSERT INTO USER(id,username,PASSWORD,STATUS,descn) VALUES(2,'user','user',1,'用户'); INSERT INTO role(id,NAME,descn) VALUES(1,'ROLE_ADMIN','管理员角色');
INSERT INTO role(id,NAME,descn) VALUES(2,'ROLE_USER','用户角色'); INSERT INTO user_role(user_id,role_id) VALUES(1,1);
INSERT INTO user_role(user_id,role_id) VALUES(1,2);
INSERT INTO user_role(user_id,role_id) VALUES(2,2);

上述共有三张表,其中user用户表,role角色表为保存用户权限数据的主表,user_role为关联表。user用户表,role角色表之间为多对多关系,就是说一个用户可以有多个角色。ER图如下所示:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASgAAAHiCAIAAADUFsacAAAgAElEQVR4nO2df4xc1Xn3T9JITaOqpOpPNa2jgkreVqKVIIoocmSIUom+NGr/SVTxqgSBlNQV+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cADEA8ABEA8AB0A8ABwA8QBwAMQDwAEQDwAHQDwAHADxAHAAxAPAARAPAAdAPAAcAPEAcADEA8ABEA8AB0A8ABwA8QBwAMQDwAEQDwAHQDwAHADxAHAAxAPAARAPAAdAPG8QQnz+859PjOj+DXHiJf5ythmYm+im8VcUKazqrAL+VUyQfj90uK7UgnbBbfE6RzjiZT4OtsfK1hzm5r6/g0q834FOxI3nBKt3t8oIIV577bWVvUsbpduEnpYeJPxUNr3tfM7qxuPg3Xuno0d2Y4XCxTM2EL0hfz4zp/KjprLCtCHGCokM/ArLEyObq5XF17qVdLam7kcv/93K1ojZROVk62TlBKhUSzdTd0By7i+RwWqP6ONmrNY7PC49jbjxtyCiL5nZMjdisW0hVB816Z0SqZ9BxsI4Sii7nz9ftyhnjm3miuN39QnSrZk4M8isSthuVWBndO5O+8cKccZrj2QQT7lJhlKrtkkF8X4HOhGMP7hnU8hVcySc6RRjxb3HH39cuVz7ZxD9UTPxI4n/V1NjtWVsoqzZUwm9LFpH+md2Z9t1jmfIXHYLZki4Ip7upU5/Hn74YWNhwv6vpnyybaLcHc6RqT7+VUzAeecyv09WGxbVDXRTCpV4ymm24nFkSGyb/lTP38EMR4BfWzXxrFwaXQsSczInL3CyVTblPho3efjhh43NKmyujNFtSJSq3DCDrgW+pw7xrFwa5RvA7FRjNlfi0WXYikdsmE28lTmJr0+ZOlmJ156WfuAjvtatJP3j1uihVbbES0QeYmnbXuncKl2GrnFtxRP6s2KadAGZjWXO103OcDwrgpdF60i/Dcpe4b9Vym5TplVuolw6W6PoyjCKl36QmNB+2v49UDdHV49I/TnUuLO6Q8qZnOcNrQ7+VUyQbnodriu1Y6Vm49Uq7cedMxMPlMdBd0yYx0qk/hyayJD2hFhO6IVMHwSrOivF/we4+7CGj6FfwwAAAABJRU5ErkJggg==" alt="" />

3.3. 获得自定义用户权限信息

现在我们要在这样的数据结构基础上使用Spring Security,Spring Security所需要的数据只是为了处理两种情况,一是判断登录用户是否合法,二是判断登陆的用户是否有权限访问受保护的系统资源。

我们所要做的工作就是在现有数据结构的基础上,为Spring Security提供这两种数据。

3.3.1. 处理用户登陆

当用户登陆时,系统需要判断用户登录名是否存在,登陆密码是否正确,当前用户是否被禁用。我们使用下列SQL来提取这三个信息。

select username,password,status as enabled
from user
where username=?

3.3.2. 检验用户权限

用户登陆之后,系统需要获得该用户的所有权限,根据用户已被赋予的权限来判断哪些系统资源可以被用户访问,哪些资源不允许用户访问。

以下SQL就可以获得当前用户所拥有的权限

select u.username,r.name as authority
from user u
join user_role ur
on u.id=ur.user_id
join role r
on r.id=ur.role_id
where u.username=?

将这两条SQL语句配置到xml中,就可以让Spring Security从我们自定义的表结构中提取数据了。最终配置文件如下所示:

<authentication-provider>
<jdbc-user-service data-source-ref="dataSource"
1users-by-username-query="select username,password,status as enabled
from user
where username=?"
2authorities-by-username-query="select u.username,r.name as authority
from user u
join user_role ur
on u.id=ur.user_id
join role r
on r.id=ur.role_id
where u.username=?"/>
</authentication-provider>

users-by-username-query为根据用户名查找用户,系统通过传入的用户名查询当前用户的登录名,密码和是否被禁用这一状态。

authorities-by-username-query为根据用户名查找权限,系统通过传入的用户名查询当前用户已被授予的所有权限。


Spring Security教程系列(一)基础篇-1的更多相关文章

  1. Spring Security教程系列(一)基础篇-2

    第 4 章 自定义登陆页面 Spring Security虽然默认提供了一个登陆页面,但是这个页面实在太简陋了,只有在快速演示时才有可能它做系统的登陆页面,实际开发时无论是从美观还是实用性角度考虑,我 ...

  2. 程序员DD 《Spring boot教程系列》补充

    最近在跟着程序员DD的Spring boot教程系列学习Spring boot,由于年代原因,Spring boot已经发生了一些变化,所以在这里进行一些补充. 补充的知识大多来自评论区,百度,Sta ...

  3. Spring Security教程(三):自定义表结构

    在上一篇博客中讲解了用Spring Security自带的默认数据库存储用户和权限的数据,但是Spring Security默认提供的表结构太过简单了,其实就算默认提供的表结构很复杂,也不一定能满足项 ...

  4. 临远的spring security教程

    为啥选择Spring Security 欢迎阅读咱们写的Spring Security教程,咱们既不想写一个简单的入门教程,也不想翻译已有的国外教程.咱们这个教程就是建立在咱们自己做的OA的基础上,一 ...

  5. Spring Security教程(三)

    在上一篇博客中讲解了用Spring Security自带的默认数据库存储用户和权限的数据,但是Spring Security默认提供的表结构太过简单了,其实就算默认提供的表结构很复杂,也不一定能满足项 ...

  6. Windows 8实例教程系列 - 数据绑定基础实例

    原文:Windows 8实例教程系列 - 数据绑定基础实例 数据绑定是WPF,Silverlight以及Windows Phone应用开发中最为常用的开发技术,在基于XAML的Windows Stor ...

  7. Spring Security教程(五):自定义过滤器从数据库从获取资源信息

    在之前的几篇security教程中,资源和所对应的权限都是在xml中进行配置的,也就在http标签中配置intercept-url,试想要是配置的对象不多,那还好,但是平常实际开发中都往往是非常多的资 ...

  8. Spring Security教程(八):用户认证流程源码详解

    本篇文章主要围绕下面几个问题来深入源码: 用户认证流程 认证结果如何在多个请求之间共享 获取认证用户信息 一.用户认证流程 上节中提到Spring Security核心就是一系列的过滤器链,当一个请求 ...

  9. Spring Security教程(二):通过数据库获得用户权限信息

    上一篇博客中,Spring Security教程(一):初识Spring Security,我把用户信息和权限信息放到了xml文件中,这是为了演示如何使用最小的配置就可以使用Spring Securi ...

随机推荐

  1. 容易忽略的z-index失效问题

    前些天写一个模仿虎牙网站幻灯片的插件,期间遇到我一直都没注意到的问题,就是z-idnex会失效的问题. 我是将幻灯片的左右按设置为float浮动的,然后在调试点击的时候发现无论怎么调高z-index都 ...

  2. hdu 1757 A Simple Math Problem (构造矩阵解决递推式问题)

    题意:有一个递推式f(x) 当 x < 10    f(x) = x.当 x >= 10  f(x) = a0 * f(x-1) + a1 * f(x-2) + a2 * f(x-3) + ...

  3. rxjava2学习笔记(1)

    1.什么是RxJava? 简单,清晰的多线程编程框架.可方便的写出维护性高,逻辑清晰的Java程序. 2.什么是观察者模式? 入门教程讲这种高大上抽象概念都是耍流氓! 3.开始 3.1github地址 ...

  4. Nodejs express 获取url参数,post参数的三种方式

    express获取参数有三种方法:官网实例: Checks route params (req.params), ex: /user/:id Checks query string params (r ...

  5. maven的web项目手工发布

    网上有很多人都认为maven的web项目发布时,要用这个命令那个命令,太麻烦了,用纯手工打造发布更为方便. 第一步,导出你所在项目maven的依赖包. 打开cmd窗口执行命令:mvn dependen ...

  6. 跟着刚哥梳理java知识点——面向对象(八)

    面向对象的核心概念:类和对象. 类:对一类事物描述,是抽象的.概念上的定义. 对象:实际存在的该类事物的每个个体,因而也成为实例(Instance). Java类及类的成员:属性(成员变量Field) ...

  7. 前端代码组织优化--小demo(进阶你的思路)

    事出必有因 最近在看老项目的代码,一个富客户端的js代码,几千行的代码,全是function(){} var...的垂直布局,真的是要感动的哭了. 一开始都是这样,想实现什么功能,不管三七二十一,fu ...

  8. [USACO11NOV]牛的障碍Cow Steeplechase

    洛谷传送门 题目描述: 给出N平行于坐标轴的线段,要你选出尽量多的线段使得这些线段两两没有交点(顶点也算),横的与横的,竖的与竖的线段之间保证没有交点,输出最多能选出多少条线段. 因为横的与横的,竖的 ...

  9. struts2 之 Action的优化配置

    总结:struts2种action的配置文件会随着业务的增加而增加,导致配置文件膨胀.struts2中提供了三种方案来解决这个问题: 1. 动态方法调用来实现. 2. 通配符配置来解决. 3. 使用注 ...

  10. Hadoop之HDFS原理及文件上传下载源码分析(上)

    HDFS原理 首先说明下,hadoop的各种搭建方式不再介绍,相信各位玩hadoop的同学随便都能搭出来. 楼主的环境: 操作系统:Ubuntu 15.10 hadoop版本:2.7.3 HA:否(随 ...