Cannot get Facebook single signon with windows 8.1 to work

人走茶凉 提交于 2019-12-04 15:36:11

this issue has been resolved. Can you please give this a try and let us know if you are still seeing the issue?

Yes, now it works :-)

This is the code I use, and it works fine:

Uri sid = WebAuthenticationBroker.GetCurrentApplicationCallbackUri();
string callbackURL = sid.ToString();
string facebookURL = "https://www.facebook.com/dialog/oauth?client_id=" + Uri.EscapeDataString(AppId) + "&display=popup&response_type=token&scope=publish_stream&redirect_uri=" + Uri.EscapeDataString(callbackURL);

var startUri = new Uri(facebookURL);

WebAuthenticationResult result = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, startUri, new Uri(callbackURL));
if (result.ResponseStatus == WebAuthenticationStatus.Success && !result.ResponseData.Contains("&error="))
{
      string resultString = result.ResponseData.Replace("#", "&");
      AccessToken = GetQueryParameter(resultString, "access_token");
      wasSuccess = true;
      IsLoggedIn = true;
      CurrentUser = await FacebookApi.GetCurrentUserId();
}

return wasSuccess;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!