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

            _formsService.SignIn(identity.Username, true);

            return Redirect();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }