Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单点登录是什么, 具体流程是什么【热度: 1,168】 #533

Open
yanlele opened this issue Aug 25, 2023 · 0 comments
Open

单点登录是什么, 具体流程是什么【热度: 1,168】 #533

yanlele opened this issue Aug 25, 2023 · 0 comments
Labels
web应用场景 应用场景类问题 小米 公司标签
Milestone

Comments

@yanlele
Copy link
Member

yanlele commented Aug 25, 2023

关键词:单点登录流程

SSO 一般都需要一个独立的认证中心(passport),子系统的登录均得通过 passport,子系统本身将不参与登录操作,当一个系统成功登录以后,passport 将会颁发一个令牌给各个子系统,子系统可以拿着令牌会获取各自的受保护资源,为了减少频繁认证,各个子系统在被 passport 授权以后,会建立一个局部会话,在一定时间内可以无需再次向 passport 发起认证。

具体流程是:

  1. 用户访问系统 1 的受保护资源,系统 1 发现用户未登录,跳转至 sso 认证中心,并将自己的地址作为参数
  2. sso 认证中心发现用户未登录,将用户引导至登录页面
  3. 用户输入用户名密码提交登录申请
  4. sso 认证中心校验用户信息,创建用户与 sso 认证中心之间的会话,称为全局会话,同时创建授权令牌
  5. sso 认证中心带着令牌跳转会最初的请求地址(系统 1)
  6. 系统 1 拿到令牌,去 sso 认证中心校验令牌是否有效
  7. sso 认证中心校验令牌,返回有效,注册系统 1
  8. 系统 1 使用该令牌创建与用户的会话,称为局部会话,返回受保护资源
  9. 用户访问系统 2 的受保护资源
  10. 系统 2 发现用户未登录,跳转至 sso 认证中心,并将自己的地址作为参数
  11. sso 认证中心发现用户已登录,跳转回系统 2 的地址,并附上令牌
  12. 系统 2 拿到令牌,去 sso 认证中心校验令牌是否有效
  13. sso 认证中心校验令牌,返回有效,注册系统 2
  14. 系统 2 使用该令牌创建与用户的局部会话,返回受保护资源
@yanlele yanlele added web应用场景 应用场景类问题 小米 公司标签 labels Aug 25, 2023
@yanlele yanlele added this to the milestone Aug 25, 2023
@yanlele yanlele changed the title 单点登录是是什么, 具体流程是什么【热度: 1,168】 单点登录是什么, 具体流程是什么【热度: 1,168】 Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web应用场景 应用场景类问题 小米 公司标签
Projects
None yet
Development

No branches or pull requests

1 participant