开发者

Facebook, OpenID & OAuth Confusion

开发者 https://www.devze.com 2023-02-15 08:50 出处:网络
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 c开发者_如何学运维an then use OAuth

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 c开发者_如何学运维an 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.


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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消