a distributed single sign-on framework
An awesome README template to jumpstart your projects!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
本篇README.md面向开发者
- concise: clean API, easy to go
- lightweight: less dependencies ,lower cost in deploy and join up
- single sign-on: only login in once to visit all verified & authorised app or website
- distribution: support distributed deployment when join up SSO verified center
- HA: Server & Client both support cluster deployment ,promote availability in system
- cross-domain: support cross-domain app join up SSO verified center
- Cookie+Token : support based on Cookie and Token way to join up separately ,give independent sample to refer
- Web+APP: support web or app join up
- real-time: system login in , logout , share together between all Server and Client
- CS-structure: based on Client-Server ,eg:include Server Verified Center and Client Protected App
- Remember password: when you dont remember pw, close browser then login state close; when you remember pw,postpone login state ; you can customize delay time (even infinity delay time).
- Path exclude: support customize multiple excluding paths, Ant expression to exclude paths that dont need to filter
- JDK 1.7+
- Redis 4.0+
- Get a free API Key at https://example.com
- Clone the repo
git clone https://github.com/shaojintian/sso-java.git
eg:
用户于Client端应用访问受限资源时,将会自动 redirect 到 SSO Server 进入统一登录界面 用户登录成功之后将会为用户分配 SSO SessionId 并 redirect 返回来源Client端应用,同时附带分配的 SSO SessionId 在Client端的SSO Filter里验证 SSO SessionId 无误,将 SSO SessionId 写入到用户浏览器Client端域名下 cookie 中 SSO Filter验证 SSO SessionId 通过,受限资源请求放行
用户与Client端应用请求注销Path时,将会 redirect 到 SSO Server 自动销毁全局 SSO SessionId,实现全局销毁 然后,访问接入SSO保护的任意Client端应用时,SSO Filter 均会拦截请求并 redirect 到 SSO Server 的统一登录界面
##1.3 基于Cookie,相关概念 登陆凭证存储:登陆成功后,用户登陆凭证被自动存储在浏览器Cookie中 Client端校验登陆状态:通过校验请求Cookie中的是否包含用户登录凭证判断 系统角色模型: SSO Server:认证中心,提供用户登陆、注销以及登陆状态校验等功能 Client应用:受SSO保护的Client端Web应用,为用户浏览器访问提供服务 用户:发起请求的用户,使用浏览器访问
##1.4 基于Token,相关概念 登陆凭证存储:登陆成功后,获取到登录凭证(xxl_sso_sessionid=xxx),需要主动存储,如存储在 localStorage、Sqlite 中 Client端校验登陆状态:通过校验请求 Header参数 中的是否包含用户登录凭证(xxl_sso_sessionid=xxx)判断;因此,发送请求时需要在 Header参数 中设置登陆凭证 系统角色模型: SSO Server:认证中心,提供用户登陆、注销以及登陆状态校验等功能 Client应用:受SSO保护的Client端Web应用,为用户请求提供接口服务 用户:发起请求的用户,如使用Android、IOS、桌面客户端等请求访问
##1.5 未登录状态请求处理 基于Cookie,未登录状态请求:
页面请求:redirect 到SSO Server登录界面 JSON请求:返回未登录的JSON格式响应数据 数据格式: code:501 错误码 msg:sso not login. 基于Token,未登录状态请求:
返回未登录的JSON格式响应数据 数据格式: code:501 错误码 msg:sso not login.
##1.6 登录态自动延期 支持自定义登录态有效期窗口,默认24H,当登录态有效期窗口过半时,自动顺延一个周期。
##1.7 记住密码 未记住密码时,关闭浏览器则登录态失效;记住密码时,登录态自动延期,在自定义延期时间的基础上,原则上可以无限延期。
##1.8 路径排除 自定义路径排除Path,允许设置多个,且支持Ant表达式。用于排除SSO客户端不需要过滤的路径。
请阅读ARCHITECTURE.md 查阅为该项目的架构。
暂无
- xxxxx
- xxxxx
- xxxxx
- xxxxx
- xxxxx
请阅读CONTRIBUTING.md 查阅为该项目做出贡献的开发者。
贡献使开源社区成为一个学习、激励和创造的绝佳场所。你所作的任何贡献都是非常感谢的。
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
该项目使用Git进行版本管理。您可以在repository参看当前可用版本。
E-mail: sjt@hnu.edu.cn
知乎:笃行er qq:1075803623
您也可以在贡献者名单中参看所有参与该项目的开发者。
该项目签署了MIT 授权许可,详情请参阅 LICENSE.txt
- GitHub Emoji Cheat Sheet
- Img Shields
- Choose an Open Source License
- GitHub Pages
- Animate.css
- xxxxxxxxxxxxxx
If you like this project and want to sponsor the author, you can reward the author using Wechat or Alipay by scanning the following QR code.