예제 #1
0
        private ActionResult CompleteSignIn(OpenIdentity identity)
        {
            if (identity == null || string.IsNullOrEmpty(identity.Username))
            {
                return(ErrorOut("Invalid Identifier"));
            }

            _formsService.SignIn(identity.Username, true);

            return(Redirect());
        }
예제 #2
0
파일: OpenId.cs 프로젝트: highwaychurch/web
        public OpenIdentity Verify()
        {
            var oid = new OpenIdentity();

            switch (_response.Status)
            {
                case AuthenticationStatus.Authenticated:
                    oid.Id = _response.ClaimedIdentifier;
                    var claimsResponse = _response.GetExtension<ClaimsResponse>();
                    oid.Username = _response.FriendlyIdentifierForDisplay;
                    break;
                case AuthenticationStatus.Canceled:
                    throw new ApplicationException("Canceled at Provider");
                case AuthenticationStatus.Failed:
                    throw new ApplicationException(_response.Exception.Message);
            }

            return oid;
        }
예제 #3
0
        private ActionResult CompleteSignIn(OpenIdentity identity)
        {
            if (identity == null || string.IsNullOrEmpty(identity.Username))
            {
                return ErrorOut("Invalid Identifier");
            }

            // Stick in next request or cookie!!!!!!!!!
            Debugger.Break();

            var cookie = Request.Cookies["returnUrl"];

            if (cookie != null)
            {
                return Redirect(cookie.Value);
            }
            else
            {
                return RedirectToAction("Index", "Home");
            }
        }