asp.net - Link facebook connect accounts to user accounts on my site -


I have a problem, where I have to start with Facebook Connect

Actually I Its application is set in Facebook and the connect button is working. Now I want to do something similar, where when entering the fax to execute, they are directed to open an account where they have to enter the username and one or two other details.

Do I need to capture the cookies back, to see if they exist and manually do this or do I miss one step?

No, using cookies is not a recommended process. I do not know ASP.Net, but the following The process works for me in other languages:

  1. Add Facebook to your HTML as described in Docs
  2. Load the call to FB.getLoginStatus on the page Example Is similar and handle responses in the following ways:
    • connected means that the use The recipient has registered for your site and has associated the FB application in this case response.authResponse will have an access token in the object in which you need to update this database in your database, this is your server Make a side code through an AJAX call.
    • No_united means that the user has not authorized the FB application associated with your site. In this case, using some javascript to reveal the "Connect" button (This point should be invisible till I think).
    • In any other case, if the user is not logged into Facebook, then just click the "Connect" button anyway.
    • Attach a call to your "Connect" button as you can see in the documentation of that method, it will pop up a permission dialog that the user will register for your app. To accept, and therefore your site Whenever they accept, your JavaScript code will receive the same type of response.authResponse object as described above, in this case, you want to separate something with access tokens. The following is just a vague idea of ​​what you want to do, but your attitude should be broadly similar.
    • In the FB logon's response function above, wherever the successful results are determined, insert some extra JavaScript that displays your sites registration form or HTML. This is probably the best if you do not redirect away from the current page, so that you can keep this code on the client side (otherwise you will need to temporarily access tokens somewhere else, etc.)
    • Allow to input your registration details in this form, and once you submit it, you retrieve the above token and the fodd user ID from authResponse above Are, with form fields
    • Process this with your server side code and store access tokens and FB UID with new registered user details.

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -