how to authenticate facebook user from facebook tab?

89 views Asked by At

What is the wrong on my code when use Facebook tab to contain game . I test it out the facebook and it worked well and authenticated facebook user and when i returned on facebook tab it wrked well. is the problem with redirection or what ? . i hope if any one help i searched more but nothing .

Facebook_login page

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        string host = System.Configuration.ConfigurationManager.AppSettings["host"];
        string facebookClientId =
          System.Configuration.ConfigurationManager.AppSettings["FacebookClientId"];
        string RedirectURL = "http://facebookapp.x.com";
        if (Request.QueryString["redirectURL"] != null)
        {
            RedirectURL = Request.QueryString["redirectURL"].ToString();
            Session["RedirectURL"] = RedirectURL;
        }
        Response.Redirect(@"https://graph.facebook.com/oauth/authorize?client_id=" +
          facebookClientId + "&redirect_uri=http://" + host +
          @"/FBcallback.aspx&scope=publish_stream,offline_access,publish_actions");
    }
}
0

There are 0 answers