Single sign on with access token
-
First of all, I know this question is only partially relevant to C#, so sorry for posting it here. I am trying to implement Facebook single sign on using a desktop application. The one thing I figured out so far is to retrieve an access token. How I retrieve the access token:
browserFacebook.Navigate(@"https://graph.facebook.com/oauth/authorize?client\_id="+ FacebookApplicationID + "&redirect_uri=http://www.facebook.com/connect/login\_success.html&type=user\_agent&display=popup");
This redirects the user to page where he/she must first authorize the application. Once authorized, I redirect the user to "http://www.facebook.com/connect/login\_success.html" as specified in the above address. I then intercept this URL to retrieve the access token like so:
string someString = browserFacebook.Url.ToString();
This returns something like the following:
"http://www.facebook.com/connect/login\_success.html#access\_token=ACCESS TOKEN.expires_in=0"
I can then easily use this access token with the Graph API to access an users facebook details as in the following code:
Facebook.FacebookGraphAPI g = new FacebookGraphAPI("ACCESS_TOKEN");
var fbUser = g.GetObject("me", null);Can I also use this token somehow to simply log a user in to the site? My goal is not really to develop a complete new facebook application as my application is simply a prototype.