Transparent user session over several sites (single sign-on + single sign-off)

后端 未结 7 1050
独厮守ぢ
独厮守ぢ 2020-12-04 06:26

I have several sites in different domains: example.com, example.org, mail.example.com and passport.example.org. All of th

7条回答
  •  -上瘾入骨i
    2020-12-04 06:46

    For this solution no need passport server.

    Signin

    1. Login
    2. Create token with encrypted session id and other info
    3. Show img with token from all you domains for setting cookies on its.

    Authorization by cookie

    1. You already have cookies on all domains.

    Sign out

    1. Clear cookie
    2. Destroy session
    3. Clear relation user id with last session id in DB (I think you save session id in user table for rising up session by cookie)

    I'm can't try this solution. But now i have same problem as you (SSO) and i try this tomorrow.

提交回复
热议问题