Shiro学习笔记之(三)Apache Shiro SecurityMananger配置

Shiro学习笔记之(二)Apache Shiro架构整体认识

Shiro的核心SecurityMananger的实现及所支持的组件都是兼容JavaBean的,因此Shiro几乎支持所有格式的配置。

一、构建SecurityMananger

1.1 INI格式构建SecurityMananger


    shiro.ini可以是在文件系统,classpath,url或uri获取。

    另外一种方式加载ini文件,利用这个org.apache.shiro.config.Ini类,其实跟properties类似。


1.2 硬编码方式构建SecurityManager

后续补充。。。。。

1.3 shiro.ini分析


[main]selection 主要配置一些SecurityManager依赖的组件



在[user]selection中的每行必须保证格式

username=password,roleName1,roleName2......

等号做左边是用户名,右边第一个是密码,后面接着是很多的角色,一个用户可以对应多个角色


[roles]selection中每个配置行都必须定义一个映射k-v的角色-权限值


下一篇    Shiro学习笔记之(四)Apache Shiro 认证(登陆)







猜你喜欢

转载自blog.csdn.net/qq_39527230/article/details/80769092