简体   繁体   English

单个标志在多个django网站上

[英]Single sign on multiple django sites


I am working in a django development with 3 sites ( siteA, siteB, siteC ) under single django code base, where every site have his own domain and own database. 我正在一个django开发中,在单个django代码库下有3个站点siteA,siteB,siteC ),每个站点都有自己的域和自己的数据库。 Because of the separate databases i have separate users for each site. 由于单独的数据库,我为每个站点分别拥有用户。

My question is: is there any possibility to create a Single Sign On to this 3 sites?? 我的问题是:是否有可能这3个网站上创建单一登录 And if a user is registered in the siteA and siteB but not in the siteC , in this case, if the user make login in the SiteA will be automatically logged in the siteB (because it is registered in both) but not in the siteC . 如果一个用户在站点A站点B,但不是在思泰科注册,在这种情况下,如果在站点A用户作出登录将在站点B可以自动登录(因为它是在两个登记),但不是在思泰科 (like stackexchange.com) (比如stackexchange.com)

Any suggestion and help is appreciated! 任何建议和帮助表示赞赏!
Thank you! 谢谢!

The ultimate solution is: OAuth 最终的解决方案是:OAuth

But if you prefer a short cut, while integrating OAuth into all these Django sites, you can: 但如果你喜欢捷径,在将OAuth集成到所有这些Django站点时,您可以:

Site A: Ken, John 网站A:肯,约翰

Site B: Ken, Joh 网站B:Ken,Joh

Site C: John 网站C:约翰

We have two sites, and the main sites using some resources from site B but it must be a user on site B. But the two websites do not sync users. 我们有两个站点,主站点使用站点B的一些资源,但它必须是站点B上的用户。但是这两个站点不同步用户。 Because OAuth was a painful integration, we are doing this: 因为OAuth是一个痛苦的整合,我们这样做:

1. Ken login through Site A.
2. As soon as he hits "login", he's redirected to login to Site B and C through iframe login (submit the auth login requests through HTTPS).

3. The iframe login will return cookies of the site trying to login
     - site B
     - site C
4. Since Ken is not a user of Site C, there is no cookies return from Site C.
5. After two iframe logins, you are back to Site A and at this moment, as authenticated user of Site A, ken has at most two cookies:
    - site A
    - site B

This is a shortcut but highly insecure. 这是一种捷径,但非常不安全。 When I say iframe login, I am not saying you will see a iframe with the login form. 当我说iframe登录时,我并不是说你会看到一个带有登录表单的iframe。 The request is sent off through request. 请求通过请求发送。

It is insecure because the users have to same the same encrypted password :/ and passing cookies around is very easy to attack. 这是不安全的,因为用户必须使用相同的加密密码:/并且传递cookie非常容易攻击。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM