springBoot 和 spring security 版本对应关系

一、背景        

        最近在看 spring security,发现没有一个明确的 springbootspring security 版本的对应关系,由于 spring security 不同版本之间的差异很大,导致写出来的代码不能按照预期的效果展示,所以我就整理了一下两者之间的版本对应关系。

        今天是 2021年11月23日,最新稳定版本的  spring boot2.3.12.RELEASE 版本,如果想查看所有的 spring boot 版本,请查询这个地址 。

二、配置相关依赖

        在我们的 pom.xml 中,可以通过这种方式引入 spring security 的依赖,如下所示:

<project xmlns="http://maven.apache.org/POM/4.0.0" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
	http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<groupId>com</groupId>
	<artifactId>SpringBoot</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>
	<name>myName</name>
	<url>www.funtl.com</url>
	
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.14.RELEASE</version>
	</parent>
	
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>

三、版本对应关系

springboot 版本

spring security版本

2.3.12.RELEASE5.3.9.RELEASE
2.3.11.RELEASE5.3.9.RELEASE
2.3.10.RELEASE5.3.9.RELEASE
2.3.9.RELEASE5.3.8.RELEASE
2.3.8.RELEASE5.3.6.RELEASE
2.3.7.RELEASE5.3.6.RELEASE
2.3.6.RELEASE5.3.5.RELEASE
2.3.5.RELEASE5.3.5.RELEASE
2.3.4.RELEASE5.3.4.RELEASE
2.3.3.RELEASE5.3.4.RELEASE
2.3.2.RELEASE5.3.3.RELEASE
2.3.1.RELEASE5.3.3.RELEASE
2.3.0.RELEASE5.3.2.RELEASE
2.2.13.RELEASE5.2.8.RELEASE
2.2.12.RELEASE5.2.8.RELEASE
2.2.11.RELEASE5.2.7.RELEASE
2.2.10.RELEASE5.2.6.RELEASE
2.2.9.RELEASE5.2.5.RELEASE
2.2.8.RELEASE5.2.5.RELEASE
2.2.7.RELEASE5.2.4.RELEASE
2.2.6.RELEASE5.2.2.RELEASE
2.2.5.RELEASE5.2.2.RELEASE
2.2.4.RELEASE5.2.1.RELEASE
2.2.3.RELEASE5.2.1.RELEASE
2.2.2.RELEASE5.2.1.RELEASE
2.2.1.RELEASE5.2.1.RELEASE
2.2.0.RELEASE5.2.0.RELEASE
2.1.18.RELEASE5.1.13.RELEASE
2.1.17.RELEASE5.1.12.RELEASE
2.1.16.RELEASE5.1.11.RELEASE
2.1.15.RELEASE5.1.11.RELEASE
2.1.14.RELEASE5.1.10.RELEASE
2.1.13.RELEASE5.1.8.RELEASE
2.1.12.RELEASE5.1.7.RELEASE
2.1.11.RELEASE5.1.7.RELEASE
2.1.10.RELEASE5.1.7.RELEASE
2.1.9.RELEASE5.1.6.RELEASE
2.1.8.RELEASE5.1.6.RELEASE
2.1.7.RELEASE5.1.6.RELEASE
2.1.6.RELEASE5.1.5.RELEASE
2.1.5.RELEASE5.1.5.RELEASE
2.1.4.RELEASE5.1.5.RELEASE
2.1.3.RELEASE5.1.4.RELEASE
2.1.2.RELEASE5.1.3.RELEASE
2.1.1.RELEASE5.1.2.RELEASE
2.1.0.RELEASE5.1.1.RELEASE
2.0.9.RELEASE5.0.12.RELEASE
2.0.8.RELEASE5.0.11.RELEASE
2.0.7.RELEASE5.0.10.RELEASE
2.0.6.RELEASE5.0.9.RELEASE
2.0.5.RELEASE5.0.8.RELEASE
2.0.4.RELEASE5.0.7.RELEASE
2.0.3.RELEASE5.0.6.RELEASE
2.0.2.RELEASE5.0.5.RELEASE
2.0.1.RELEASE5.0.4.RELEASE
2.0.0.RELEASE5.0.3.RELEASE
1.5.22.RELEASE4.2.13.RELEASE
1.5.21.RELEASE4.2.12.RELEASE
1.5.20.RELEASE4.2.12.RELEASE
1.5.19.RELEASE4.2.11.RELEASE
1.5.18.RELEASE4.2.10.RELEASE
1.5.17.RELEASE4.2.9.RELEASE
1.5.16.RELEASE4.2.8.RELEASE
1.5.15.RELEASE4.2.7.RELEASE
1.5.14.RELEASE4.2.7.RELEASE
1.5.13.RELEASE4.2.6.RELEASE
1.5.12.RELEASE4.2.5.RELEASE
1.5.11.RELEASE4.2.5.RELEASE
1.5.10.RELEASE4.2.4.RELEASE
1.5.9.RELEASE4.2.3.RELEASE
1.5.8.RELEASE4.2.3.RELEASE
1.5.7.RELEASE4.2.3.RELEASE
1.5.6.RELEASE4.2.3.RELEASE
1.5.5.RELEASE4.2.3.RELEASE
1.5.4.RELEASE4.2.3.RELEASE
1.5.3.RELEASE4.2.2.RELEASE
1.5.2.RELEASE4.2.2.RELEASE
1.5.1.RELEASE4.2.1.RELEASE
1.5.0.RELEASE4.2.1.RELEASE
1.4.7.RELEASE4.1.4.RELEASE
1.4.6.RELEASE4.1.4.RELEASE
1.4.5.RELEASE4.1.4.RELEASE
1.4.4.RELEASE4.1.4.RELEASE
1.4.3.RELEASE4.1.4.RELEASE
1.4.2.RELEASE4.1.3.RELEASE
1.4.1.RELEASE4.1.3.RELEASE
1.4.0.RELEASE4.1.1.RELEASE
1.3.8.RELEASE4.0.4.RELEASE
1.3.7.RELEASE4.0.4.RELEASE

  • 10
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 5
    评论
`sql -- 超级管理员,拥有系统最高权限 select * from sys_user where super_admin_flag = 1 -- 租户管理员 select * from sys_user where admin_flag = 1 -- 是否超级管理员菜单(0否1是),如创建菜单后,菜单栏不显示,注意检查此字段是否对应正确 select * from sys_menu where super_flag = 1 ``` multi_tenant.sql脚本中初始化了超级管理员的账号密码 1.使用admin/admin123登录系统 2.打开 租户管理-权限模板-新增,添加一个权限模板,指定模板拥有的菜单权限 ![超级管理员-新增权限模板](https://images.gitee.com/uploads/images/2020/1221/165014_a69e2bdd_2024853.png "image-20201221160550454.png") 3.打开 租户管理-租户列表-新增,新增一个租户,选择刚才的权限模板 ![超级管理员-创建租户](https://images.gitee.com/uploads/images/2020/1221/165113_8a7a7217_2024853.png "image-20201221160752827.png") 4.登出系统,使用刚才创建的租户账号重新登录系统,默认账号是上图中填写的手机号 13866688888,默认密码是123456. ```properties # 默认的租户密码 sys.default.pwd=123456. ``` ```sql # 菜单下租户数据隔离,comId可以在上下文登陆用户信息中取到 select * from order where com_id = #{comId} ``` 登录后进入租户首页 ![租户管理员-首页](https://images.gitee.com/uploads/images/2020/1221/165142_6393d144_2024853.png "image-20201221161209345.png") 租户管理员可以创建角色,并且给角色分配该租户已有的权限,然后创建租户下的用户,并分配 ## 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。
在boot项目中,security是一种重要的安全机制,用于保护应用程序免受未经授权的访问和攻击。 首先,security可以用于身份验证和授权。通过使用security,我们可以实现用户的注册和登录功能,确保只有经过身份验证的用户才能访问受保护的资源。通过配置安全规则和访问权限,可以限制用户对特定页面或功能的访问,从而保护敏感信息和资源的安全性。 其次,security还可以用于密码加密和用户凭证管理。在boot项目中,我们可以使用security提供的加密算法对用户的密码进行加密存储,确保密码不会以明文形式保存在数据库中。此外,security还提供了用户凭证管理功能,包括密码重置、账户锁定等功能,以增强应用程序的安全性。 另外,security还可以用于防止跨站点请求伪造(CSRF)和跨站脚本攻击(XSS)等安全威胁。通过配置security规则和过滤器,我们可以防止恶意用户利用这些攻击手段来攻击应用程序,并保护用户数据的安全性。 此外,security还提供了许多其他的安全特性,如安全日志记录、会话管理、防御注入攻击等。通过合理地配置和使用security,我们可以提高boot项目的安全性,并保护应用程序和用户的安全。 总之,在boot项目中使用security是非常重要的,它可以帮助我们保护应用程序免受未经授权的访问和攻击,并提供一系列安全特性和工具来加强应用程序的安全性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

快乐的小三菊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值