shiro

Springboot+shiro+md5(配置类配置)

天涯浪子 提交于 2019-11-30 04:34:47
一.导入依赖包 <!--spring boot 默认lettuce连接redis的技术--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--邮件--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> <!--jdbc依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <!--前端模板引擎依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <!--springmvc-->

Shiro整合Redis代码解读

旧街凉风 提交于 2019-11-30 04:28:42
1. shiro默认使用的MemoryConstrainedCacheManager创建MapCache来保存缓存数据。manager和cache对象之间的关系可以参考笔者的另一篇文章,Springboot Redis详解。 2. shiro整合Redis的关键就是重写MemoryConstrainedCacheManager和MapCache。 3. shiro提供了CacheManagerAware来标志使用Cache的地方,有Realm、SecurityManager、SessionManager和SessionDao。前三个能理解,第四个还要再进一步学习。 3.shiro的SessionDAO 来源: https://my.oschina.net/u/3651261/blog/3108766

springcloud vue 微服务 分布式 activiti工作流 前后分离 集成代码生成器 shiro权限

五迷三道 提交于 2019-11-30 03:56:25
本商品为 :springcloud + Springboot 微服务\分布式 工作流 前后分离 + 跨域 版本 (权限控制到菜单和按钮) 后台框架 :springcloud Greenwich.SR1 + springboot 2.1.4 + activiti6.0.0 + mybaits + maven + json 接口 前端页面 :html +vue.js 形式 jquery ajax 异步跨域 json 格式数据交互 前后分离,前后台分开部署 特别注意 :前端用的vue.js, 就是html页面引入vue.js形式, 用tomcat部署运行,更适合后台开发者 手机功能 :IM、工作流任务管理审批,站内信,上传头像,修改资料,好友管理 等 核心技术 ---------------------------------------------------------------------------------------------------------------------- 1.代码生成器: [正反双向](单表、主表、明细表、树形表,快速开发利器) freemaker模版技术 ,0个代码不用写,生成完整的一个模块,带页面、建表sql脚本、处理类、service等完整模块 2.多数据源: (支持同时连接无数个数据库,可以不同的模块连接不同数的据库)支持N个数据源 3.

How to implement row-level security in Java?

▼魔方 西西 提交于 2019-11-30 03:52:09
问题 I am currently evaluating authentication / authorization frameworks. Apache Shiro seems to be very nice but I am missing row-level security features. E.g. there might be special rows in a database which should only visible and accessible by users with special privileges. To avoid unnecessary round-trips, we currently modify the SQL queries to join with our authorization data to get only the visible rows for the current user. But this concepts doesn't feel 'right' to me, because we mix

persistence.xml to import database parameters values from .properties file

我只是一个虾纸丫 提交于 2019-11-30 02:58:27
问题 Edit: not duplicate but almost I would like to have my app persistence.xml to be something like <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="appName" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb

springboot整合shiro-spring-boot-web-starter实现前后端分离的跨域问题

﹥>﹥吖頭↗ 提交于 2019-11-30 01:20:42
最近从github上发现一个不错的项目,项目使用的是springboot整合shiro-spring-boot-web-starter实现前后端分离技术, 但部署的启动后,出现了一些问题。 这里是借鉴的文章: https://segmentfault.com/a/1190000013630601 https://www.cnblogs.com/yfzhou/p/9813177.html https://www.jianshu.com/p/dbe441dcdbcf https://segmentfault.com/a/1190000014479154 这里是github上面的项目连接: https://github.com/CaiBaoHong/biu 这里是shiro官方文档: https://shiro.apache.org/spring-boot.html 项目本身采用的是gradle项目架构,我将其改为maven后发现了一个问题,关于登陆时,获取用户详细信息被shiro的过滤器拦截了下来。导致无法获取数据。同样的代码,在gradle上,没有问题,反而在maven架构上,出现了问题。百思不得其,实在没办法后只能通过修改shiro的过滤器,让其放行OPTIONS的请求。具体实现如下: 首先是jar: <dependency> <groupId>org.apache.shiro<

springboot2 集成shiro-spring-boot-web-starter

本秂侑毒 提交于 2019-11-30 01:19:46
目录 1.引包 2. 配置shiro 2.1 配置类 2.2 登录页配置 2.3 shiro默认过滤器 2.4 自定义Reaml类 3 用户登录 3.1 页面设计 3.2 登录处理 3.3 密码匹配原理 4. 权限管理 4.1 url和注解组合使用 4.2 @RequireXXX注解可能的Bug 4.3 注解权限 shiro是web开发中常用的使用安全管理框架,通过shiro-spring-boot-web-starter方式集成Shiro到springboot2可以简化配置。 1.引包 maven方式在项目pom.xml中引入shiro starter包的坐标,这里引用了1.4.1版本 <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring-boot-web-starter</artifactId> <version>1.4.1</version> </dependency> 2. 配置shiro starter已经做了很多自动配置工作,具体可以参考ShiroAutoConfiguration.java、ShiroBeanAutoConfiguration.java和ShiroWebAutoConfiguration.java这几个文件。 2.1 配置类 这里使用新建shiroConfig

springboot全家桶,集成shiro,rabbitmq,redis, mybatis,druid,swagger

Deadly 提交于 2019-11-29 23:50:34
搭建了一个SpringBoot的模板,下载即可作为单体应用的服务后台模板 项目地址: https://gitee.com/devilscode/springboot_template 项目集成框架 springboot 作为基础框架 shiro 权限管理 rabbitmq 消息中间件 redis 缓存 mybatis 持久层框架 druid 数据源 和 资源监控 swagger 做API接口文档 核心 pom.xml <?xml version="1.0" encoding="UTF-8"?> <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.example.springboot-shiro</groupId> <artifactId>springboot-template</artifactId> <version>0.0.1

整合 SpringMVC 3.2.5 和 Shiro 1.2.3

ぃ、小莉子 提交于 2019-11-29 23:30:59
按着《 SpringMVC整合Shiro 》这篇博文来做即可。但是,在启动时发现Spring的配置被载入两次,很明显SpringMVC 和 Shiro 所使用的不是同一个 Spring Application Context。在参考《 ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别 》后,web.xml 配置改为: ...... <filter> <filter-name>shiroFilter</filter-name> <filter-class> org.springframework.web.filter.DelegatingFilterProxy </filter-class> <init-param> <param-name>targetFilterLifecycle</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>contextAttribute</param-name> <param-value> org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatch </param-value> <

SpringBoot整合shiro

拟墨画扇 提交于 2019-11-29 23:18:26
导入依赖 <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.4.0</version> </dependency> 配置安全管理器 /** * @Description:shiro配置 * @author Chen * @create 2019-07-07 20:02 */ @Configuration public class ShiroConfig { /** * 创建ShiroFilterFactoryBean */ @Bean public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager securityManager){ ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); //设置安全管理器 shiroFilterFactoryBean.setSecurityManager(securityManager); // setLoginUrl 如果不设置值