How to get Facebook user ID during deauthorization

I am using the new Facebook C # SDK 5.0.2 and I had the following problem: During detonation of the application, I have the value singed_request. Unfortunately, they do not have an accesstoken, so if I use CanvasAuthorizer and Session is null, so I don’t know which user should mark as disabled in my application.

Is there any workaround for this situation?

+3
source share
1 answer

You can parse a signed request using ... FacebookSignedRequest.Parse

string signedRequestValue = Request.Form["signed_request"];
var app = new FacebookApp();
var sig = FacebookSignedRequest.Parse(((FacebookConfigurationSection)ConfigurationManager.GetSection("facebookSettings")).AppSecret, signedRequestValue);
long userid = long.Parse(sig.UserId);
+3
source

Source: https://habr.com/ru/post/1790832/


All Articles