Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthFacebook oAuth = new AuthFacebook();

            if (Session["token"] == null)
            {
                Response.Redirect(oAuth.GetAuthorizationLink());
            }
            else
            {
                oAuth.Token = Session["token"].ToString();

                var url = "https://graph.facebook.com/me?access_token=" + oAuth.Token;
                string json = oAuth.Request(AuthFacebook.Method.GET, url, String.Empty);
                ltrJson.Text = json;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string url = "";
            AuthFacebook oAuth = new AuthFacebook();

            if (Request["code"] == null)
            {
                Response.Redirect(oAuth.GetAuthorizationLink());
            }
            else
            {
                oAuth.GetAccessToken(Request["code"]);

                if (oAuth.Token.Length > 0)
                {
                    Session["token"] = oAuth.Token;
                    Response.Redirect("~/Default.aspx");
                }
            }
        }