Giter Site home page Giter Site logo

yii-sso-eg's Introduction

Yii 2 Advanced SSO Login Example

实现SSO登陆的步骤如下:

  • 子系统点击登陆,带上redirect作为返回路径跳转到sso统一登录页面(passport)进行 登录。

  • 用户在passport登录之后(写入passport的session,cookie等登录信息),通过js向各个 子系统的登录接口(并带上passport的临时票据ticket)

  • 子系统的登录接口中,确定请求的合法性,并根据请求的临时票据ticket请求passport服务器获 取用户信息(这里是服务器跟服务器直接通讯,因此passport需要能够根据ticket获取到用户信息), 并将用户信息写入登陆状态中,登录用户,写子系统的session,cookie

  • 所有子系统写完之后,根据一开始请求passport的跳转参数redirect进行跳转条主, 回到登录前的子系统

退出过程:

  • 子系统点击退出,跳转到passport的退出操作,并生存退出票据ticket
  • passport退出页面中可通过ajax请求各个子系统
  • 各个子系统判断ticket的合法性,退出用户

目录:


auth    auth server

frontend  client test

yii-sso-eg's People

Contributors

froyot avatar

Watchers

dengwei avatar  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.