Searching user from e-mail
I would like to map my website users to their Facebook account. Sin开发者_StackOverflow社区ce I have their e-mails I would like to know how can I find their Facebook user Id programmatically.
Outlook Social connector does this, so I assume this is possible.
Thanks,
First you have to ask the user on facebook for permission to there email this can be done by adding "email" to CanvasAuthorizer Perms. all you have to do is a get on "me" and it will be in that return.
var auth = new CanvasAuthorizer ();
auth.Perms = "email";
if( Auth.Authorize() )
{
var fb = new FacebookClient( Auth.Session.AccessToken );
dynamic me = fb.Get( "me" );
string email = me.email;
}
精彩评论