예제 #1
0
        private AuthorizeState VerifyAuthentication(string returnUrl)
        {
            switch (_openIdRelyingPartyService.Response.Status)
            {
            case AuthenticationStatus.Authenticated:
                var parameters = new OpenIdAuthenticationParameters(_openIdRelyingPartyService.Response);
                return(new AuthorizeState(returnUrl, _authorizer.Authorize(parameters)));

            case AuthenticationStatus.Canceled:
            {
                var result = new AuthorizeState(returnUrl, OpenAuthenticationStatus.AssociateOnLogon);
                return(result);
            }

            case AuthenticationStatus.Failed:
            {
                var result = new AuthorizeState(returnUrl, OpenAuthenticationStatus.Error);
                result.AddError(_openIdRelyingPartyService.Response.Exception.Message);
                return(result);
            }
            }
            return(new AuthorizeState(returnUrl, OpenAuthenticationStatus.Unknown));
        }
예제 #2
0
 private AuthorizeState VerifyAuthentication(string returnUrl)
 {
     switch (_openIdRelyingPartyService.Response.Status)
     {
         case AuthenticationStatus.Authenticated:
             var parameters = new OpenIdAuthenticationParameters(_openIdRelyingPartyService.Response);
             return new AuthorizeState(returnUrl, _authorizer.Authorize(parameters));
         case AuthenticationStatus.Canceled:
             {
                 var result = new AuthorizeState(returnUrl, OpenAuthenticationStatus.AssociateOnLogon);
                 return result;
             }
         case AuthenticationStatus.Failed:
             {
                 var result = new AuthorizeState(returnUrl, OpenAuthenticationStatus.Error);
                 result.AddError(_openIdRelyingPartyService.Response.Exception.Message);
                 return result;
             }
     }
     return new AuthorizeState(returnUrl, OpenAuthenticationStatus.Unknown);
 }