0

In Facebook Javascript SDK when I use:

FB.login(function (response) {
            //code here
}

I can acess userID "response.authResponse.userID", but when I use Facebook C# SDK the method oAuthClient.ExchangeCodeForAccessToken(code) only return AcessToken and Expires and I must make one more call to get this info.

How can I get userID without making one more call?

prabir
  • 7,674
  • 4
  • 31
  • 43
Thiago Burgo
  • 91
  • 2
  • 12

1 Answers1

0

You will need to make one more request to get the user id from the access token which is a safer route.

if you do want to get without making a call, refer to this post instead.

How to get the Facebook user id using the access token

Community
  • 1
  • 1
prabir
  • 7,674
  • 4
  • 31
  • 43
  • thanks for quick response, but I cant understand why my acesstoken is not like "1249203702|2.h1MTNeLqcLqw__.86400.129394400-605430316|-WE1iH_CV-afTgyhDPc" but is more like this: "AAADOFHuZBFNcBABE6gCrlKkaox94dkFDVg0DBaZBPdzAnhN3sS3oh9nAm7toH2SZAMoXH1e14fWBAJVRQ1XT0iIVTirhaONDJhVwwplBeKsZCRKYku1P" in my javascript code (with oauth=true) I can get UserId, Expires, SignedRequest, Status etc... but I cant do this in Facebook SDK without use Get("/me"). – Thiago Burgo Sep 05 '11 at 08:21