0

I have a registration-login system on my own website yet I want to add Facebook Connect too. I have some required parts of my user table as:

Username Password Email

The first thing that came to my mind is, setting userId as username, userId@facebook.com as email and setting the password to null and check if a record exists with these details in my user table. If not insert a new user with these details, if exists return that user details.

Is this a good design? How should I connect facebook connect to my website?

Thank you

Pabuc
  • 5,430
  • 6
  • 33
  • 51

1 Answers1

0

I would suggest you to take this into a more deep ASP.NET, and start an MVC project

then use the Microsoft Facebook API SDK to play around with the API, it's very easy and because they are using the new dynamic type, now that Facebook changed the Open Graph, it will continue to work great as well.

in your login page, add a facebook login button and ask for permissions, for example:

<fb:login-button perms="email" size="medium">
    redirect-uri="http://yourdomain.com/FBLogin/"
    Subscribe using Facebook</fb:login-button>

in your FBLogin controller, login the user using the FB credentials, if the user uses your normal form, use the normal login

If you create a custom MemberShip Provider, you can easily use that for both accesses... I write a simple start to a custom Membership provider here

Community
  • 1
  • 1
balexandre
  • 69,002
  • 44
  • 219
  • 321
  • I'm already 90% the project and want to implement just facebook connect. Why would I start a MVC project for this? :| – Pabuc Sep 23 '11 at 08:17
  • it's a good way to start in the MVC world, as I'm sure it will be much simpler to maintain ... though the **Membership provider** is not only for MVC, it's for any .NET web project and the Facbeook API can be use is Webforms as well. You should read that I said **I would suggest**, the rest of the answer does not depend on it, it was only a suggestion, my answer is still the way to go in my opinion – balexandre Sep 23 '11 at 09:58