1 Star 1 Fork 0

何同学 / springboot-shiro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Shrio学习笔记

SpringBoot-Shrio

学习环境

IDEA 2020

SpringBoot 2.3.0

Shiro 1.5.3

Thymeleaf - shiro 2.0.0

1.Shrio核心三大对象

  • Subject 用户
  • SecurityManager 管理用户
  • Realm 连接数据

2.引入整合包

2.1 SpringBoot整合Shiro

        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-spring</artifactId>
            <version>1.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-core</artifactId>
            <version>1.5.3</version>
        </dependency>

2.2 Thymeleaf整合Shiro

         <dependency>
            <groupId>com.github.theborakompanioni</groupId>
            <artifactId>thymeleaf-extras-shiro</artifactId>
            <version>2.0.0</version>
        </dependency>

3.编写配置类

  • 自定义Realm对象

作用:用于授权和认证。 验证登录权限,获取并设置登录用户的权限。

  • ShiroConfig

拿到自定义的Realm对象,并将其绑定到安全管理器中,主要在安全管理器中设置拦截、设置权限、登录校验等操作。

空文件

简介

SpringBoot-Shiro学习笔记 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/hale459/SpringBoot-Shiro.git
git@gitee.com:hale459/SpringBoot-Shiro.git
hale459
SpringBoot-Shiro
springboot-shiro
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891