4 writes to Failure
Microsoft.AspNetCore.Authentication (2)
HandleRequestResult.cs (2)
45return new HandleRequestResult() { Failure = failure }; 56return new HandleRequestResult() { Failure = failure, Properties = properties };
Microsoft.AspNetCore.Authentication.Abstractions (2)
AuthenticateResult.cs (2)
101return new AuthenticateResult() { Failure = failure }; 112return new AuthenticateResult() { Failure = failure, Properties = properties };
32 references to Failure
Aspire.Dashboard (1)
Authentication\AspirePolicyEvaluator.cs (1)
109if (authenticationResult.Failure != null && (authenticationResult.Properties?.GetParameter<bool>(SuppressChallengeKey) ?? false))
Aspire.Dashboard.Tests (6)
OtlpApiKeyAuthenticationHandlerTests.cs (6)
28Assert.NotNull(result.Failure); 29Assert.Equal($"API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header is missing.", result.Failure.Message); 42Assert.NotNull(result.Failure); 43Assert.Equal($"Incoming API key from '{OtlpApiKeyAuthenticationHandler.ApiKeyHeaderName}' header doesn't match configured API key.", result.Failure.Message); 56Assert.Null(result.Failure); 73Assert.Equal(success, result.Failure == null);
JwtBearerSample (2)
Startup.cs (2)
56else if (authResult.Failure != null) 59ExceptionDispatchInfo.Capture(authResult.Failure).Throw();
Microsoft.AspNetCore.Authentication (6)
AuthenticationHandler.cs (2)
225if (result.Failure == null) 239Logger.AuthenticationSchemeNotAuthenticatedWithFailure(Scheme.Name, result.Failure.Message);
RemoteAuthenticationHandler.cs (4)
102exception = authResult.Failure ?? new InvalidOperationException("Invalid return state, unable to redirect."); 132else if (errorContext.Result.Failure != null) 134throw new AuthenticationFailureException("An error was returned from the RemoteFailure event.", errorContext.Result.Failure); 197if (result.Failure != null)
Microsoft.AspNetCore.Authentication.Abstractions (2)
AuthenticateResult.cs (2)
62if (Failure != null) 64return Fail(Failure, Properties?.Clone());
Microsoft.AspNetCore.Authentication.Certificate (2)
CertificateAuthenticationHandler.cs (2)
80if (result.Failure != null) 82var authenticationFailedContext = await HandleFailureAsync(result.Failure);
Microsoft.AspNetCore.Authentication.JwtBearer (1)
JwtBearerHandler.cs (1)
280AuthenticateFailure = authResult?.Failure
Microsoft.AspNetCore.Authentication.Negotiate (2)
NegotiateHandler.cs (2)
282else if (errorContext.Result.Failure != null) 284throw new AuthenticationFailureException("An error was returned from the AuthenticationFailed event.", errorContext.Result.Failure);
Microsoft.AspNetCore.Authentication.OpenIdConnect (4)
OpenIdConnectHandler.cs (4)
146if (remoteSignOutContext.Result.Failure != null) 148throw new InvalidOperationException("An error was returned from the RemoteSignOut event.", remoteSignOutContext.Result.Failure); 343if (signOut.Result.Failure != null) 345throw new InvalidOperationException("An error was returned from the SignedOutCallbackRedirect event.", signOut.Result.Failure);
Microsoft.AspNetCore.Authentication.Test (6)
CookieTests.cs (2)
1864if (result.Failure != null) 1866throw new Exception("Failed to authenticate", result.Failure);
JwtBearerTests.cs (2)
1177if (result.Failure != null) 1179throw new Exception("Failed to authenticate", result.Failure);
JwtBearerTests_Handler.cs (2)
1244if (result.Failure != null) 1246throw new Exception("Failed to authenticate", result.Failure);