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
        public OpenIdentity Verify()
        {
            var oid = new OpenIdentity();

            switch (_response.Status)
            {
                case AuthenticationStatus.Authenticated:
                    oid.Id = _response.ClaimedIdentifier;
                    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
        public OpenIdentity Verify()
        {
            var oid = new OpenIdentity();

            switch (_response.Status)
            {
            case AuthenticationStatus.Authenticated:
                oid.Id       = _response.ClaimedIdentifier;
                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);
        }