コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FacebookLogin fblog = new FacebookLogin(AppId, ExtendedPermissions);

            FacebookOAuthResult oauthResult;

            if (fblog._fb.TryParseOAuthCallbackUrl(fblog._loginUrl, out oauthResult))
            {
                // The url is the result of OAuth 2.0 authentication
                Response.Write(oauthResult.AccessToken);
            }
            else
            {
                // The url is NOT the result of OAuth 2.0 authentication.
                Response.Redirect(fblog._loginUrl.AbsoluteUri);
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            FacebookLogin fblog = new FacebookLogin(AppId, ExtendedPermissions);


            FacebookOAuthResult oauthResult;

            if (fblog._fb.TryParseOAuthCallbackUrl(fblog._loginUrl, out oauthResult))
            {
                // The url is the result of OAuth 2.0 authentication
                Response.Write(oauthResult.AccessToken);
            }
            else
            {
                // The url is NOT the result of OAuth 2.0 authentication.
                Response.Redirect(fblog._loginUrl.AbsoluteUri);
            }
        }