Coder Social home page Coder Social logo

sso's Introduction

单点登录步骤

    用户未登录时访问子站 A,子站 A 服务器检测到用户没登录(没有本站 session),于是通知浏览器跳转到 SSO 服务站点,并在跳转的 URL 参数中带上当前页面地址,以便登录后自动跳转回本页。
    SSO 服务站点检测到用户没有登录,于是显示登录界面。
    1.1. 用户提交登录请求到服务端,服务端验证通过,创建对应的用户登录凭据(token)。然后服务端通知浏览器把该 token 作为 SSO 服务站点的 cookie 存储起来,并将 token 作为参数带着跳转回子站 A。
    1.2. 子站 A 服务端检测到浏览器请求的 URL 中带了单点登录的 token,于是把这个 token 发到 SSO 服务站点验证(不能随便加上一个 token 就让通过是吧)。
    SSO 服务端拿 token 查询出用户信息,把账号信息中允许子站 A 访问的部分信息返回给子站 A。
    子站 A 根据返回的信息生成用户在本站的会话,把会话对应 cookie 写入浏览器,从而完成在本站的登入以及会话的保持。之后用户再次访问子站 A 时,都会带上这个 cookie,从而保持在本站的登录状态。
    用户再访问子站 B,子站 B 的服务器检测到用户没登录,于是通知浏览器跳转到 SSO 服务站点。
    浏览器访问 SSO 服务站点时会带上上述创建的包含 token 的 cookie。SSO 服务站点根据该 token 能找到对应用户,于是通知浏览器跳转回子站 B,并在跳转回去的 URL 参数中带上这个 token。
    子站 B 服务端检测到浏览器请求的 URL 中带上了单点登录的 token,于是又会走上述对应步骤验证 token,完成用户在本站的自动登录。

sso's People

Contributors

zhangmengmengmeng avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.