资源简介
原创Shiro整合SSO教程:http://blog.csdn.net/m0_37797991/article/details/78529096

代码片段和文件信息
package com.demo.base;
import com.demo.entity.system.SysUser;
import com.demo.base.CookieUtil;
import com.demo.base.SerializeUtil;
import com.demo.utils.RhinoConstant;
import redis.clients.jedis.Jedis;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
public class SSOTokenUtil {
public static SysUser getToken(HttpServletRequest request){
String token = request.getParameter(“token“);
if(null == token) {
Cookie cookie = CookieUtil.getCookieByName(request “token“);
token = cookie != null ? cookie.getValue() : null;
}
if(null == token){
return null;
}
PropertiesTool propertiesTool = PropertiesTool .getInstance();
String JedisUrl = propertiesTool.getValue(“JedisUrl“);
String JedisPort = propertiesTool.getValue(“JedisPort“);
String microServiceId = propertiesTool.getValue(“microServiceId“);
Jedis jedis = new Jedis(JedisUrl Integer.parseInt(JedisPort));
byte[] bytes = token.getBytes();
byte[] userBytes = jedis.get(bytes);
SysUser currentUser = (SysUser) SerializeUtil.deSerialize(userBytes);
if(null!=currentUser){
currentUser.setRemarks(microServiceId);
}
jedis.close();
return currentUser;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 905 2017-11-14 11:43 util\PropertiesTool.java
文件 1366 2017-11-14 11:40 ba
文件 3181 2017-11-14 11:41 sso\SSOFilter.java
文件 550 2017-11-13 10:15 sso\SystemSession.java
目录 0 2017-11-14 11:42 util
目录 0 2017-11-13 19:57 ba
目录 0 2017-11-13 20:06 sso
----------- --------- ---------- ----- ----
6002 7
- 上一篇:400多份响应式网站模板
- 下一篇:OA办公自动化项目源码及视频讲解教程四套
相关资源
- SSM+Shiro+redis实现单点登陆
- 跟我学shiro pdf带目录版
- 2018年SpringBoot与Shiro整合-权限管理实战
- shiro登录验证
- jfinalShiroEasyui
- ssm+shiro+easyui权限管理系统
- springboot+springdatajpa+thymeleaf+shiro 的管理
- Apache Shiro技术详解
- springboot+shiro+md5
- shiro 中文 API文档
- springboot+Shiro 实现动态授权
- spring boot+mybatis+thymeleaf+apache shiro开发
- 跟我学Shiro PDF版教程与源码. 张开涛
- Springboot+shiro简单登录案例
- spring boot+mybatis+thymeleaf+apache shiro开发
- Spring+SpringMVC+Mybatis+AdminLTE(BootStrap)
- shiro官方文档中文
- springboot + shiro + mybatis-plus + beetl后台管
- 跟我学Shiro教程.rar
- shiro反序列化复现.zip
- springMVC+hibernate+spring+shiro整合
- Shiro学习,以及与SpringMVC整合,标签注
- ssm整合shrio框架
- 高仿小米商城对应的后台管理系统
- BNF-寇申海.rar
- springboot+mybatis+layui+shiro 权限注解-后台
- springboot+mybatis+shiro+rabbitmq+redis项目实
- 高仿京淘项目
- ssm+shiro+redis 登录控制及重试次数超过
- Shiro和AJAX完美整合
评论
共有 条评论