Login to website using Facebook account

58,606

Solution 1

Mixu had meticulously explained single sign-on in his 3 paged blog:

1) http://blog.mixu.net/2010/12/27/implementing-facebook-login-single-sign-on-part-1/

2) http://blog.mixu.net/2011/01/03/implementing-facebook-login-part-2/

3) http://blog.mixu.net/2011/01/09/implementing-facebook-login-part-3/

UPDATE

SSO is simply logging a user with facebook and maintaining a site-wide session on your server and cookie on user's machine. This session shall remain valid for all pages on your website. You can use this codeplex example in C# to get you going on the right track: http://facebooktoolkit.codeplex.com/

Also see this answer (in C#) for more info: https://stackoverflow.com/a/369691/842837

Solution 2

There are many ways you can implement this. These architectures are explained in the Facebook developer page.

The simplest way is to implement it using javascript sdk. Here is a link on how to login using Facebook account.

Solution 3

We can authenticate user from server side as well as client side.. if you are looking for a javascript solution then please refer below mentioned method.

  • Browse this link https://developers.facebook.com
    • Click on apps tab. >> It will promt you for login.
    • Once you are logged in >> you can create an new app in your account.
    • Click on settings tab(from left pannel)>> then click on "advanced" tab on the right window.
    • under "Valid OAuth redirect URIs" >> enter proper url (for testing you can enter your localhost url also, something like localhost.com:98 etc) if you are using iis you can configure the port number there.
    • if required you will have to put this url in your host file as well.
    • from the dashboard tab you can get the appid and secrect key for the newly created app.(we will need this in later stage).
Share:
58,606
Akansha Gulati
Author by

Akansha Gulati

Updated on July 09, 2022

Comments

  • Akansha Gulati
    Akansha Gulati almost 2 years

    I want to implement SSO in our current website so that we can login to that website using a Facebook account. Can you please provide the steps which I need to follow to implement it?