Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            IAuthorizationState authorization = facebookClient.ProcessUserAuthorization();

            if (authorization == null)
            {
                // Kick off authorization request
                facebookClient.RequestUserAuthorization();

                // alternatively you can ask for more information
                // facebookClient.RequestUserAuthorization(scope: new[] { FacebookClient.Scopes.Email, FacebookClient.Scopes.UserBirthday });
            }
            else
            {
                IOAuth2Graph oauth2Graph = facebookClient.GetGraph(authorization);
                //// IOAuth2Graph oauth2Graph = facebookClient.GetGraph(authorization, new[] { FacebookGraph.Fields.Defaults, FacebookGraph.Fields.Email, FacebookGraph.Fields.Picture, FacebookGraph.Fields.Birthday });

                this.nameLabel.Text = HttpUtility.HtmlEncode(oauth2Graph.Name);
            }
        }