6 instantiations of HandleRequestResult
Microsoft.AspNetCore.Authentication (6)
HandleRequestResult.cs (6)
11private static readonly HandleRequestResult _noResult = new() { None = true }; 12private static readonly HandleRequestResult _skippedResult = new() { Skipped = true }; 13private static readonly HandleRequestResult _handledResult = new() { Handled = true }; 35return new HandleRequestResult() { Ticket = ticket, Properties = ticket.Properties }; 45return new HandleRequestResult() { Failure = failure }; 56return new HandleRequestResult() { Failure = failure, Properties = properties };
80 references to HandleRequestResult
Microsoft.AspNetCore.Authentication (25)
Events\HandleRequestContext.cs (4)
27/// The <see cref="HandleRequestResult"/> which is used by the handler. 29public HandleRequestResult Result { get; protected set; } = default!; 35public void HandleResponse() => Result = HandleRequestResult.Handle(); 40public void SkipHandler() => Result = HandleRequestResult.SkipHandler();
Events\RemoteAuthenticationContext.cs (3)
42public void Success() => Result = HandleRequestResult.Success(new AuthenticationTicket(Principal!, Properties, Scheme.Name)); 48public void Fail(Exception failure) => Result = HandleRequestResult.Fail(failure); 54public void Fail(string failureMessage) => Result = HandleRequestResult.Fail(failureMessage);
Events\ResultContext.cs (1)
51public void Success() => Result = HandleRequestResult.Success(new AuthenticationTicket(Principal!, Properties, Scheme.Name));
HandleRequestResult.cs (11)
11private static readonly HandleRequestResult _noResult = new() { None = true }; 12private static readonly HandleRequestResult _skippedResult = new() { Skipped = true }; 13private static readonly HandleRequestResult _handledResult = new() { Handled = true }; 32public static new HandleRequestResult Success(AuthenticationTicket ticket) 43public static new HandleRequestResult Fail(Exception failure) 54public static new HandleRequestResult Fail(Exception failure, AuthenticationProperties? properties) 64public static new HandleRequestResult Fail(string failureMessage) 73public static new HandleRequestResult Fail(string failureMessage, AuthenticationProperties? properties) 81public static HandleRequestResult Handle() => _handledResult; 87public static HandleRequestResult SkipHandler() => _skippedResult; 93public static new HandleRequestResult NoResult() => _noResult;
RemoteAuthenticationHandler.cs (6)
87var authResult = await HandleRemoteAuthenticateAsync(); 189protected abstract Task<HandleRequestResult> HandleRemoteAuthenticateAsync(); 286/// <returns>The <see cref="HandleRequestResult"/>.</returns> 287protected virtual async Task<HandleRequestResult> HandleAccessDeniedErrorAsync(AuthenticationProperties properties) 324return HandleRequestResult.Handle(); 327return HandleRequestResult.NoResult();
Microsoft.AspNetCore.Authentication.OAuth (12)
HandleRequestResults.cs (2)
8internal static HandleRequestResult InvalidState = HandleRequestResult.Fail("The oauth state was missing or invalid.");
OAuthHandler.cs (10)
64protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync() 79return HandleRequestResult.Fail("Correlation failed.", properties); 94var result = await HandleAccessDeniedErrorAsync(properties); 104return HandleRequestResult.Fail(deniedEx, properties); 123return HandleRequestResult.Fail(ex, properties); 130return HandleRequestResult.Fail("Code was not found.", properties); 138return HandleRequestResult.Fail(tokens.Error, properties); 143return HandleRequestResult.Fail("Failed to retrieve access token.", properties); 185return HandleRequestResult.Success(ticket); 189return HandleRequestResult.Fail("Failed to retrieve user information from remote server.", properties);
Microsoft.AspNetCore.Authentication.OpenIdConnect (23)
HandleRequestResults.cs (4)
8internal static HandleRequestResult UnexpectedParams = HandleRequestResult.Fail("An OpenID Connect response cannot contain an identity token or an access token when using response_mode=query"); 9internal static HandleRequestResult NoMessage = HandleRequestResult.Fail("No message.");
OpenIdConnectHandler.cs (19)
632/// <returns>An <see cref="HandleRequestResult"/>.</returns> 633protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync() 654return HandleRequestResult.SkipHandler(); 679return HandleRequestResult.SkipHandler(); 706return HandleRequestResult.SkipHandler(); 708return HandleRequestResult.Fail(Resources.MessageStateIsNullOrEmpty); 720return HandleRequestResult.SkipHandler(); 724return HandleRequestResult.Fail(Resources.MessageStateIsInvalid); 729return HandleRequestResult.Fail("Correlation failed.", properties); 742var result = await HandleAccessDeniedErrorAsync(properties); 749return HandleRequestResult.Fail(CreateOpenIdConnectProtocolException(authorizationResponse, response: null), properties); 926return HandleRequestResult.Success(new AuthenticationTicket(user, properties, Scheme.Name)); 948return HandleRequestResult.Fail(exception, properties); 1039/// <returns><see cref="HandleRequestResult"/> which is used to determine if the remote authentication was successful.</returns> 1040protected virtual async Task<HandleRequestResult> GetUserInformationAsync( 1049return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name)); 1054return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name)); 1077return HandleRequestResult.Fail("Unknown response type: " + contentType?.MediaType, properties); 1106return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name));
Microsoft.AspNetCore.Authentication.Twitter (9)
HandleRequestResults.cs (2)
8internal static HandleRequestResult InvalidStateCookie = HandleRequestResult.Fail("Invalid state cookie.");
TwitterHandler.cs (7)
58protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync() 79var result = await HandleAccessDeniedErrorAsync(properties); 81: HandleRequestResult.Fail("Access was denied by the resource owner or by the remote server.", properties); 87return HandleRequestResult.Fail("Missing oauth_token", properties); 92return HandleRequestResult.Fail("Unmatched token", properties); 98return HandleRequestResult.Fail("Missing or blank oauth_verifier", properties); 137return HandleRequestResult.Success(ticket);
Microsoft.AspNetCore.Authentication.WsFederation (11)
HandleRequestResults.cs (4)
8internal static HandleRequestResult NoMessage = HandleRequestResult.Fail("No message."); 9internal static HandleRequestResult UnsolicitedLoginsNotAllowed = HandleRequestResult.Fail("Unsolicited logins are not allowed.");
WsFederationHandler.cs (7)
148protected override async Task<HandleRequestResult> HandleRemoteAuthenticateAsync() 173return HandleRequestResult.SkipHandler(); 217return HandleRequestResult.Fail("Correlation failed.", properties); 223return HandleRequestResult.Fail(Resources.SignInMessageWresultIsMissing, properties); 230return HandleRequestResult.Fail(Resources.SignInMessageTokenIsMissing, properties); 349return HandleRequestResult.Success(new AuthenticationTicket(principal, properties, Scheme.Name)); 368return HandleRequestResult.Fail(exception, properties);