dongtangjie0495 2012-06-18 09:37
浏览 34
已采纳

使用透明登录过程跨多个站点进行相同登录

The issue

Let's say that I have example.com, example.org and example.net.

All of these sites have a login which authenticates against the same base of user credentials.

I'm looking for at efficient way to only log in one place but still having the ability to be transparently logged in at the sites sites.

My current solution
...is having an iframe loading a resource on one of the sites (which I call main site) and if the user is logged in at the main site, refresh the page using a token and automagically log in the user through some JavaScript.

But this is really ineffecient and insecure for several reasons:

  • User needs to log in at the main site
  • User needs to refresh his page, using some clientside code (I'm aware that it might not be possible to avoid this).
  • Using iframes is generally frowned upon and some even have browser plugins blocking these.

What I'm not looking for
I'm not interested in using some third party provider like Facebook, Google or an OpenID provider as this would require my users to register with third party websites to use my services.

Summing up to the specific question
Just like Google and even StackOverflow, the process between the sites authentication seems transparent I need something similar. What is the better option to my current solution?

  • 写回答

1条回答 默认 最新

  • douchilian1009 2012-06-18 09:56
    关注

    I cannot share code ... but the solution I implemented involved a middle-man to handle the authentication for all my sites... which we called an SSO Broker....

    Basically, all login requests go via the SSO Broker, it will determine if you have logged in already in sitea when trying to access siteb.

    ... The closet I can point you to for how we implemented it is: http://www.jasny.net/articles/simple-single-sign-on-for-php/

    The other sso solutions all have their place too, but some are more complex than required.

    The other simple approach is, simply passing some (secure-ish) token between each other.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线