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);
 }
        private AuthorizeState TranslateResponseState(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));
        }