28 references to Fail
Aspire.Dashboard (5)
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (2)
22return Task.FromResult(AuthenticateResult.Fail("No type specified on this connection.")); 27return Task.FromResult(AuthenticateResult.Fail($"Connection type {Options.RequiredConnectionType} is not enabled on this connection."));
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (3)
31return Task.FromResult(AuthenticateResult.Fail($"Multiple '{ApiKeyHeaderName}' headers in request.")); 38return Task.FromResult(AuthenticateResult.Fail($"Incoming API key from '{ApiKeyHeaderName}' header doesn't match configured API key.")); 44return Task.FromResult(AuthenticateResult.Fail($"API key from '{ApiKeyHeaderName}' header is missing."));
Aspire.Hosting (3)
Dashboard\DashboardServiceAuth.cs (3)
43return Task.FromResult(AuthenticateResult.Fail($"'{ApiKeyHeaderName}' header not found")); 48return Task.FromResult(AuthenticateResult.Fail($"Expecting only a single '{ApiKeyHeaderName}' header.")); 53return Task.FromResult(AuthenticateResult.Fail($"Invalid '{ApiKeyHeaderName}' header value."));
Microsoft.AspNetCore.Authentication (2)
Events\ResultContext.cs (1)
68public void Fail(string failureMessage) => Result = AuthenticateResult.Fail(failureMessage);
RemoteAuthenticationHandler.cs (1)
215return AuthenticateResult.Fail("Remote authentication does not directly support AuthenticateAsync");
Microsoft.AspNetCore.Authentication.BearerToken (2)
BearerTokenHandler.cs (2)
19private static readonly AuthenticateResult FailedUnprotectingToken = AuthenticateResult.Fail("Unprotected token failed"); 20private static readonly AuthenticateResult TokenExpired = AuthenticateResult.Fail("Token expired");
Microsoft.AspNetCore.Authentication.Certificate (3)
AuthenticateResults.cs (3)
8internal static AuthenticateResult NoSelfSigned = AuthenticateResult.Fail("Options do not allow self signed certificates."); 9internal static AuthenticateResult NoChainedCertificates = AuthenticateResult.Fail("Options do not allow chained certificates."); 10internal static AuthenticateResult InvalidClientCertificate = AuthenticateResult.Fail("Client certificate failed validation.");
Microsoft.AspNetCore.Authentication.Cookies (5)
AuthenticateResults.cs (5)
8internal static AuthenticateResult FailedUnprotectingTicket = AuthenticateResult.Fail("Unprotect ticket failed"); 9internal static AuthenticateResult MissingSessionId = AuthenticateResult.Fail("SessionId missing"); 10internal static AuthenticateResult MissingIdentityInSession = AuthenticateResult.Fail("Identity missing in session store"); 11internal static AuthenticateResult ExpiredTicket = AuthenticateResult.Fail("Ticket expired"); 12internal static AuthenticateResult NoPrincipal = AuthenticateResult.Fail("No principal.");
Microsoft.AspNetCore.Authentication.JwtBearer (2)
AuthenticateResults.cs (2)
8internal static AuthenticateResult ValidatorNotFound = AuthenticateResult.Fail("No SecurityTokenValidator available for token."); 9internal static AuthenticateResult TokenHandlerUnableToValidate = AuthenticateResult.Fail("No TokenHandler was able to validate the token.");
Microsoft.AspNetCore.Authentication.Test (1)
AuthenticationMiddlewareTests.cs (1)
88.Returns(Task.FromResult(AuthenticateResult.Fail("not authenticated")));
Microsoft.AspNetCore.Authorization.Test (4)
PolicyEvaluatorTests.cs (3)
77var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Fail("Nooo"), context, resource: null); 112var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Fail("Nooo"), context, resource: null); 190=> Task.FromResult(AuthenticateResult.Fail("Sad."));
TestObjects\TestAuthenticationService.cs (1)
30return Task.FromResult(AuthenticateResult.Fail("Denied"));
Microsoft.AspNetCore.Mvc.Core.Test (1)
Authorization\AuthorizeFilterTest.cs (1)
614auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Fails")).ReturnsAsync(AuthenticateResult.Fail("Fails"));