1

当我尝试使用 facebook 登录我的网站时,我被重定向到https://www.facebook.com/login.php?login_attempt=1,它一直运行良好,直到昨天。我正在使用 facebook sdk 和这段代码

Facebook.Components.FacebookService _fbService = new Facebook.Components.FacebookService();

private const string FACEBOOK_API_KEY = "MY KEY";
private const string FACEBOOK_SECRET = "MY SECRET";


protected void Page_Load(object sender, EventArgs e)
{

    // ApplicationKey and Secret are acquired when you sign up for 
    _fbService.ApplicationKey = FACEBOOK_API_KEY;
    _fbService.Secret = FACEBOOK_SECRET;
    _fbService.IsDesktopApplication = false;

    string sessionKey = Session["facebook_session_key"] as String;
    string userId = Session["facebook_userId"] as String;

    // When the user uses the facebook login page, the redirect back here will will have the auth_token in the query params
    string authToken = Request.QueryString["auth_token"];

    // We have already established a session on behalf of this user
    if (!String.IsNullOrEmpty(sessionKey))
    {
        _fbService.SessionKey = sessionKey;
        _fbService.UserId = userId;
    }
    // This will be executed when facebook login redirects to our page
    else if (!String.IsNullOrEmpty(authToken)) 
    {
        _fbService.CreateSession(authToken);
        Session["facebook_session_key"] = _fbService.SessionKey;
        Session["facebook_userId"] = _fbService.UserId;
        Session["facebook_session_expires"] = _fbService.SessionExpires;
    }
    // Need to login
    else 
    {
        Response.Redirect(@"http://www.facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0");
    }

facebook 是否有任何更改会阻止此工作?

编辑 * - 当我清除缓存并尝试在此 url 登录页面时

%22%2C%22sig%22%3A%2246ad34e0d00fae8cd9f9cf2daee78ff3%22%7D#=_">http://www.facebook.com/connect/uiserver.php?installed=1&session=%7B%22session_key%22%3A% 222.AQDNQYFHVJC-YJVP.3600.1351616400.1-58522540%%22%2C%2C%22UID%22%3A5852540%2C%2C%2C%22 Expires%22 Expires%22%22%22%3A13516161616161616161616161616161616400222222222222222222222222222222222度22秒22.22%22.22%22. 2246ad34e0d00fae8cd9f9cf2daee78ff3%22%7D# =_

好像它不能重定向到我的网站?

4

0 回答 0