Facebook、OpenID 和OAuth 混乱
我网站上的用户可以使用他们的用户名和密码或通过 OpenID 登录(他们第一次这样做时,它会对他们进行身份验证,然后在网站上注册他们)。然后,我可以使用 OAuth 将用户帐户连接到 facebook/twitter 以获取他们的访问令牌。
我遇到的问题是用户必须对自己进行两次身份验证。对于网站上的基本评论系统来说,这似乎有点过分了。据我了解,facebook 不是 OpenID 提供商。我看到几个网站都有一个连接到 Facebook 的按钮,但我怎样才能达到将他们的 Facebook 身份验证与其用户帐户联系起来的相同效果。例如,如果他们在发表评论时注销,他们可以使用他们的 Facebook 身份验证发布评论,然后这将在他们可以登录的网站上注册他们。
我希望我已经足够清楚地解释了我的意图。我可能只是有点困惑。
users on my site can login with their username and password or via OpenID (the first time they do this it authenticates them and then registers them on the site). I can then use OAuth to connect the user's account to facebook/twitter to get their access token.
The problem I have is that the user has to authenticate themselves twice. For a basic commenting system on the site this seems like over kill. From my understanding facebook is not an OpenID provider. I have seen several sites have a connect to facebook button but how could I achieve the same effect which ties their facebook authentication to their user account. For example if they are logged out at the time of commenting they can post their comment using their facebook authentication, this will then register them on the site which they can then login.
I hope I've explained my intentions clear enough. I'm probably just getting slightly confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确,Facebook 不是 OpenID 提供商,正如您所说,他们使用 OAuth。
你的问题有点模糊。我对我的用户必须进行两次身份验证没有问题。
让您的用户选择他们想要进行身份验证的平台,然后使用正确的 API/代码来连接和注册它们。 Facebook 和 OAuth 有一个单独的代码部分。
当用户回来时,您可以检查他们是否登录了 Facebook,并自动对他们进行身份验证,因为他们允许您的应用程序。
如果您需要更多信息,请发表评论,我会尽力提供帮助:)
Correct, Facebook is not an OpenID provider, they use OAuth just as you say.
Your question is a bit vague. I have no problem with my users having to authenticate twice.
Let your user choose which platform they want to authenticate with, and then use the proper API/code to connect and register them. Have a separate code section for Facebook and OAuth.
When the user come back you can check if they are logged in on facebook and auto-authenticate them since they have allowed your application.
If you need further information, please comment and I'll try to help :)