Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            OAuth oauth = new OAuth(AppKey, AppSecret, AppCallbackUrl);

            var authenticationUrl = oauth.GetAuthorizeURL(state);
            Session["requeststate"] = state;

            Response.Redirect(authenticationUrl);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["code"] != null)
            {
                OAuth oauth = new OAuth(AppKey, AppSecret, AppCallbackUrl);
                var token = oauth.GetAccessToken(Request["code"], state);

                var openid = oauth.GetOpenID(token.Token, state);
                Session["LoginInfo"] = openid.openid;

            }
        }