I am looking at using the facebook SDK and I am wondering first what version should I be using?
It looks like some major changes are happened from 4.2 to 5(currently still in beta). Should I go ahead and use the beta? Anyone have any ides when it will be out of beta?
My second question is how can I use it for authentication.
Right now I am using DotNetOpenAuth to do all my openId authentication for my site. I am using there sort of plugin for facebook authentication(oAuth) however I am planning to use more facebook features on my site so I think it is kinda pointless to use this plugin and then the sdk libary when the library seems to be able to do it all.
Anways how do I do authentication with the sdk library. I want to have a button on my login page that they click it goes off to facebook they become authenticated and I get some request back saying that they where authenticated and then I give them a cookie and let them in.
All the tutorials I seen to have it that your just using facebook as your only authentication method but of course for me I have openId, facebook and twitter.
Regarding 4.2 vs 5.0 BETA I guess you need to decide whether you want to use a BETA version or a stable version. I am sure they have a changelog in their BETA Release you can look at for the changes since the older version.
Regarding authentication using Facebook. I have a project where I support standard Forms authentication and accounts creation as well as Facebook login. In my AccountController I have one action for Forms login and one for Facebook login.
To configure the Facebook assembly you can follow the tutorial you have posted, then you can put a Facebook button on your page and similar code to begin the authentication process:
The facebook aciton works by:
Pseudo code:
So the idea is that I delegate the authentication to those 3rd party services and then create a user on my system with the information I can fetch from them. Also in my project, because I want the user to set/very some preferences after the account is created I redirect them to the page where they can do that.
P.S: A tip regarding running your web project locally in Visual Studio. You can create a private Facebook App with “Site URL” set to e.g. “http://localhost:4911/” and use that appId. This will allow you to play with Facebook locally.