コード例 #1
0
        public ActionResult LoginWithYandex(string code)
        {
            var accessToken = YandexAuth.GetAuthorizationCookie(Response.Cookies, code, Db);

            FormsAuthentication.SetAuthCookie(accessToken, true);

            return(RedirectToActionPermanent("Index", "Home"));
        }
コード例 #2
0
        public ActionResult LoginWithYandex(string code)
        {
//            var userCookie = YandexAuth.GetAuthorizationCookie(Request);
            //  MonitorLog.WriteLog(string.Format("GetAuthorizationCookie({0})", Repository), MonitorLog.typelog.Info, true);
            var accessToken = YandexAuth.GetAuthorizationCookie(Response.Cookies, code, Db);

            //  MonitorLog.WriteLog(string.Format("accessToken = {0}", accessToken), MonitorLog.typelog.Info, true);

            FormsAuthentication.SetAuthCookie(accessToken, true);

            return(RedirectToActionPermanent("Index", "Home"));
        }