1 Star 0 Fork 36

pcchina / OAuth2-SSO

forked from 小确信 / OAuth2-SSO 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

单点登录 springboot+shiro+oltu+thymeleaf+vue.js


项目介绍

Maven项目, 字符编码: UTF-8;

基于springboot框架整合shiro安全验证框架,基于oltu实现oauth2单点登录认证
前端采用thymeleaf+vue.js实现
项目由core,web_oauth2_server,app_oauth2_server三部分组成
core为核心验证逻辑
web_oauth2_server提供web前端通过跳转方式登录
app_oauth2_server提供手机app登录接口

主要技术版本
JDK(1.8)
springboot(2.2.4.RELEASE)
shiro(1.4.2)
oltu(1.0.2)


功能列表

当前版本 V1.0.9
1.支持扫码登录、账号密码、短信验证码登录、相同session免登录(后面版本扩充多种登录方式认证)
2.支持authorization_code,password,refresh_token三种获取token方式
3.支持redis session缓存
4.支持热用户,热客户端暂存 (账号信息,客户端信息访问后暂存redis中,下次请求直接访问redis不在请求数据库,长期不使用会被清理)
5.支持账号登录互斥功能(不同电脑或手机登录时踢出之前登录账号)
6.支持登录日志记录


后期计划
v1.1.0
1.增加流控

v2.0.0
1.增加权限管理


安装教程

  1. 使用MAVEN命令将代码导入到idea或者其他IDE中
  2. 安装lombok插件(如果已安装忽略此步骤)
  3. 执行目录中 SQL建表语句 创建登录相关表
  4. 安装本机redis,并启动
  5. 运行

使用说明

http://localhost:19888/swagger-ui.html查看接口文档
  1. 获取code
    访问http://localhost:19888/oauth2/authorize?response_type=code&client_id={client_id}&redirect_uri={redirect_uri}&state={state}

  2. 输入账号admin 密码!QAZ2wsx 提交

  3. 系统回调{redirect_uri}?code={code}&state={state}

    示例:
    访问 http://localhost:19888/oauth2/authorize?response_type=code&client_id=system&redirect_uri=http://baidu.com
    返回 http://baidu.com?code=****************

  4. 获取token
    根据回调返回code,post方式调用http://localhost:19888/oauth2/accessToken接口返回token信息
    注意:Content-Type=application/x-www-form-urlencoded

    示例参数:
    header配置Content-Type=application/x-www-form-urlencoded
    [{"key":"client_id","value":"system","description":""},{"key":"client_secret","value":"system","description":""},{"key":"grant_type","value":"authorization_code","description":""},{"key":"code","value":"77c9c36b1d9ef13f366d20f47789c80b","description":""},{"key":"redirect_uri","value":"http://baidu.com","description":""}]

  5. 获取用户信息
    get方式请求http://localhost:19888/user/info?access_token={access_token}获取用户信息

    示例:
    http://localhost:19888/user/info?access_token=****************
    或者
    也可将token信息放入header中 设置Authorization=Bearer{access_token} get请求http://localhost:19888/user/info

  6. 用户登出
    访问http://localhost:19888/user/revoke 登出账号

MIT License Copyright (c) 2020 秋风 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

OAuth2单点登录 软件架构springboot+shiro+oltu+thymeleaf+vue.js 基于springboot框架整合shiro安全验证框架,基于oltu实现oauth2单点登录认证 前端采用thymeleaf+vue.js实现 展开 收起
Java
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/pcchina/SSO.git
git@gitee.com:pcchina/SSO.git
pcchina
SSO
OAuth2-SSO
master

搜索帮助