Reputation: 1
i need for getting Username of people are visiting my page... I'm following below istructions: https://developers.facebook.com/docs/authentication/signed_request/
Ive written the following code:
string _authorizationUrl = string.Format("https://www.facebook.com/dialog/oauth?client_id={0}&redirect_uri={1}", FB_APPID, Server.UrlEncode(FB_CANVAS_PAGE));
string _signedRequest = Request["signed_request"] as string;
string[] _valuesInRequest = _signedRequest.Split(new char[] {'.'}, 2);
string _stringToDecode = _valuesInRequest[1].Replace("-_","+/");
System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding();
System.Text.Decoder decoder = encoding.GetDecoder();
byte[] _byteToDecode = Convert.FromBase64String(_stringToDecode);
int charCount = decoder.GetCharCount(_byteToDecode, 0, _byteToDecode.Length);
char[] _decodedChar = new char[charCount];
decoder.GetChars(_byteToDecode, 0, _byteToDecode.Length, _decodedChar, 0);
string result = new String(_decodedChar);
Im logged in Facebook and i get this result:
{"algorithm":"HMAC-SHA256","issued_at":1316602539,"page":{"id":"XXXXXX","liked":false,"admin":false},"user":{"country":"it","locale":"it_IT","age":{"min":21}}}
with no info aabout username. why? can anyone helps me?
thank you
Upvotes: 0
Views: 679
Reputation: 52063
This information is not, and probably never will be, available due to privacy concerns. The only way to get identifiying information about who is visiting your Facebook page is to make the user authenticate with your application and having them approve it. Then you could call the graph api at /me to get their id and name.
Upvotes: 1