1 type derived from AuthenticateResult
Microsoft.AspNetCore.Authentication (1)
HandleRequestResult.cs (1)
9public class HandleRequestResult : AuthenticateResult
4 instantiations of AuthenticateResult
Microsoft.AspNetCore.Authentication.Abstractions (4)
AuthenticateResult.cs (4)
14private static readonly AuthenticateResult _noResult = new() { None = true }; 82return new AuthenticateResult() { Ticket = ticket, Properties = ticket.Properties }; 101return new AuthenticateResult() { Failure = failure }; 112return new AuthenticateResult() { Failure = failure, Properties = properties };
307 references to AuthenticateResult
Aspire.Dashboard (25)
Authentication\AspirePolicyEvaluator.cs (10)
37/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> failed to authenticate.</returns> 38public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 46var result = await context.AuthenticateAsync(scheme).ConfigureAwait(false); 72return AuthenticateResult.Success(ticket); 77return AuthenticateResult.NoResult(); 84static AuthenticateResult DefaultAuthenticateResult(HttpContext context) 87? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User")) 88: AuthenticateResult.NoResult(); 103/// Otherwise returns <see cref="PolicyAuthorizationResult.Forbid(AuthorizationFailure)"/> if <see cref="AuthenticateResult.Succeeded"/>, otherwise 105public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (4)
16protected override Task<AuthenticateResult> HandleAuthenticateAsync() 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.")); 30return Task.FromResult(AuthenticateResult.NoResult());
Authentication\FrontendCompositeAuthenticationHandler.cs (2)
19protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 24return AuthenticateResult.Fail(
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (5)
22protected override Task<AuthenticateResult> HandleAuthenticateAsync() 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.")); 47return Task.FromResult(AuthenticateResult.NoResult());
Authentication\OtlpCompositeAuthenticationHandler.cs (2)
22protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 38return AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name));
Authentication\UnsecuredAuthenticationHandler.cs (2)
17protected override Task<AuthenticateResult> HandleAuthenticateAsync() 23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), Scheme.Name)));
Aspire.Dashboard.Tests (4)
OtlpApiKeyAuthenticationHandlerTests.cs (4)
25var result = await handler.AuthenticateAsync().DefaultTimeout(); 39var result = await handler.AuthenticateAsync().DefaultTimeout(); 53var result = await handler.AuthenticateAsync().DefaultTimeout(); 70var result = await handler.AuthenticateAsync().DefaultTimeout();
Aspire.Hosting (5)
Dashboard\DashboardServiceAuth.cs (5)
35protected override Task<AuthenticateResult> HandleAuthenticateAsync() 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.")); 58AuthenticateResult.Success(
BasicWebSite (3)
BasicAuthenticationHandler.cs (3)
17protected override Task<AuthenticateResult> HandleAuthenticateAsync() 21return Task.FromResult(AuthenticateResult.NoResult()); 34return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(
CookieSample (1)
Program.cs (1)
57var ticket = await context.AuthenticateAsync();
CustomAuthorizationFailureResponse (2)
Authentication\SampleAuthenticationHandler.cs (2)
20protected override Task<AuthenticateResult> HandleAuthenticateAsync() 21=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
DynamicSchemes (1)
SimpleAuthHandler.cs (1)
20protected override Task<AuthenticateResult> HandleAuthenticateAsync()
Identity.DefaultUI.WebSite (2)
Services\ContosoAuthenticationHandler.cs (2)
22protected override Task<AuthenticateResult> HandleAuthenticateAsync() => 23Task.FromResult(AuthenticateResult.NoResult());
JwtBearerSample (1)
Startup.cs (1)
51var authResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
Microsoft.AspNetCore.Authentication (24)
AuthenticationFeatures.cs (3)
15private AuthenticateResult? _result; 17public AuthenticationFeatures(AuthenticateResult result) 22public AuthenticateResult? AuthenticateResult
AuthenticationHandler.cs (9)
18private Task<AuthenticateResult>? _authenticateTask; 215public async Task<AuthenticateResult> AuthenticateAsync() 224var result = await HandleAuthenticateOnceAsync() ?? AuthenticateResult.NoResult(); 248protected Task<AuthenticateResult> HandleAuthenticateOnceAsync() 263protected async Task<AuthenticateResult> HandleAuthenticateOnceSafeAsync() 271return AuthenticateResult.Fail(ex); 278/// <returns>The <see cref="AuthenticateResult"/>.</returns> 279protected abstract Task<AuthenticateResult> HandleAuthenticateAsync();
AuthenticationMiddleware.cs (1)
62var result = await context.AuthenticateAsync(defaultAuthenticate.Name);
Events\ResultContext.cs (5)
44/// Gets the <see cref="AuthenticateResult"/> result. 46public AuthenticateResult? Result { get; private set; } 56public void NoResult() => Result = AuthenticateResult.NoResult(); 62public void Fail(Exception failure) => Result = AuthenticateResult.Fail(failure); 68public void Fail(string failureMessage) => Result = AuthenticateResult.Fail(failureMessage);
PolicySchemeHandler.cs (1)
53protected override Task<AuthenticateResult> HandleAuthenticateAsync()
RemoteAuthenticationHandler.cs (5)
192protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 194var result = await Context.AuthenticateAsync(SignInScheme); 208return AuthenticateResult.Success(new AuthenticationTicket(ticket.Principal, 212return AuthenticateResult.NoResult(); 215return AuthenticateResult.Fail("Remote authentication does not directly support AuthenticateAsync");
Microsoft.AspNetCore.Authentication.Abstractions (18)
AuthenticateResult.cs (9)
14private static readonly AuthenticateResult _noResult = new() { None = true }; 17/// Creates a new <see cref="AuthenticateResult"/> instance. 56public AuthenticateResult Clone() 79public static AuthenticateResult Success(AuthenticationTicket ticket) 89public static AuthenticateResult NoResult() 99public static AuthenticateResult Fail(Exception failure) 110public static AuthenticateResult Fail(Exception failure, AuthenticationProperties? properties) 120public static AuthenticateResult Fail(string failureMessage) 129public static AuthenticateResult Fail(string failureMessage, AuthenticationProperties? properties)
AuthenticationHttpContextExtensions.cs (4)
21/// <returns>The <see cref="AuthenticateResult"/>.</returns> 22public static Task<AuthenticateResult> AuthenticateAsync(this HttpContext context) => 30/// <returns>The <see cref="AuthenticateResult"/>.</returns> 31public static Task<AuthenticateResult> AuthenticateAsync(this HttpContext context, string? scheme) =>
IAuthenticateResultFeature.cs (1)
17AuthenticateResult? AuthenticateResult { get; set; }
IAuthenticationHandler.cs (2)
23/// <returns>The <see cref="AuthenticateResult"/> result.</returns> 24Task<AuthenticateResult> AuthenticateAsync();
IAuthenticationService.cs (1)
20Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string? scheme);
TokenExtensions.cs (1)
139var result = await auth.AuthenticateAsync(context, scheme);
Microsoft.AspNetCore.Authentication.BearerToken (7)
BearerTokenHandler.cs (7)
19private static readonly AuthenticateResult FailedUnprotectingToken = AuthenticateResult.Fail("Unprotected token failed"); 20private static readonly AuthenticateResult TokenExpired = AuthenticateResult.Fail("Token expired"); 24protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 40return AuthenticateResult.NoResult(); 55return AuthenticateResult.Success(ticket);
Microsoft.AspNetCore.Authentication.Certificate (27)
AuthenticateResults.cs (6)
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.");
CertificateAuthenticationHandler.cs (6)
48protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 54return AuthenticateResult.NoResult(); 65return AuthenticateResult.NoResult(); 70var cacheHit = _cache.Get(Context, clientCertificate); 77var result = await ValidateCertificateAsync(clientCertificate); 115private async Task<AuthenticateResult> ValidateCertificateAsync(X509Certificate2 clientCertificate)
CertificateValidationCache.cs (8)
13/// MemoryCache based implementation used to store <see cref="AuthenticateResult"/> results after the certificate has been validated 36/// Get the <see cref="AuthenticateResult"/> for the connection and certificate. 40/// <returns>the <see cref="AuthenticateResult"/></returns> 41public AuthenticateResult? Get(HttpContext context, X509Certificate2 certificate) 42=> _cache.Get<AuthenticateResult>(ComputeKey(certificate))?.Clone(); 45/// Store a <see cref="AuthenticateResult"/> for the connection and certificate 49/// <param name="result">the <see cref="AuthenticateResult"/></param> 50public void Put(HttpContext context, X509Certificate2 certificate, AuthenticateResult result)
ICertificateValidationCache.cs (7)
10/// Cache used to store <see cref="AuthenticateResult"/> results after the certificate has been validated 15/// Get the <see cref="AuthenticateResult"/> for the connection and certificate. 19/// <returns>the <see cref="AuthenticateResult"/></returns> 20AuthenticateResult? Get(HttpContext context, X509Certificate2 certificate); 23/// Store a <see cref="AuthenticateResult"/> for the connection and certificate 27/// <param name="result">The <see cref="AuthenticateResult"/></param> 28void Put(HttpContext context, X509Certificate2 certificate, AuthenticateResult result);
Microsoft.AspNetCore.Authentication.Cookies (18)
AuthenticateResults.cs (10)
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.");
CookieAuthenticationHandler.cs (8)
33private Task<AuthenticateResult>? _readCookieTask; 82private Task<AuthenticateResult> EnsureCookieTicket() 150private async Task<AuthenticateResult> ReadCookieTicket() 155return AuthenticateResult.NoResult(); 196return AuthenticateResult.Success(ticket); 200protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 202var result = await EnsureCookieTicket(); 226return AuthenticateResult.Success(new AuthenticationTicket(context.Principal, context.Properties, Scheme.Name));
Microsoft.AspNetCore.Authentication.Core (4)
AuthenticationService.cs (4)
59public virtual async Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string? scheme) 78var result = (await handler.AuthenticateAsync()) ?? AuthenticateResult.NoResult(); 95return AuthenticateResult.Success(new AuthenticationTicket(principal, result.Properties, result.Ticket!.AuthenticationScheme));
Microsoft.AspNetCore.Authentication.Core.Test (12)
AuthenticationSchemeProviderTests.cs (1)
258public Task<AuthenticateResult> AuthenticateAsync()
AuthenticationServiceTests.cs (9)
255public Task<AuthenticateResult> AuthenticateAsync() 257return Task.FromResult(AuthenticateResult.Success( 282public Task<AuthenticateResult> AuthenticateAsync() 284return Task.FromResult(AuthenticateResult.NoResult()); 315public Task<AuthenticateResult> AuthenticateAsync() 317return Task.FromResult(AuthenticateResult.NoResult()); 343public Task<AuthenticateResult> AuthenticateAsync() 345return Task.FromResult(AuthenticateResult.NoResult()); 381public Task<AuthenticateResult> AuthenticateAsync()
TokenExtensionTests.cs (2)
154public Task<AuthenticateResult> AuthenticateAsync() 165return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), props, "simple")));
Microsoft.AspNetCore.Authentication.JwtBearer (9)
AuthenticateResults.cs (4)
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.");
JwtBearerHandler.cs (5)
56protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 81return AuthenticateResult.NoResult(); 92return AuthenticateResult.NoResult(); 193return AuthenticateResult.Fail(authenticationFailedContext.Exception); 277var authResult = await HandleAuthenticateOnceSafeAsync();
Microsoft.AspNetCore.Authentication.Negotiate (4)
NegotiateHandler.cs (4)
295protected override async Task<AuthenticateResult> HandleAuthenticateAsync() 308return AuthenticateResult.NoResult(); 313return AuthenticateResult.NoResult(); 375return AuthenticateResult.Success(ticket);
Microsoft.AspNetCore.Authentication.Negotiate.Test (1)
NegotiateHandlerTests.cs (1)
465var result = await context.AuthenticateAsync();
Microsoft.AspNetCore.Authentication.Test (40)
AuthenticationMiddlewareTests.cs (8)
65.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 88.Returns(Task.FromResult(AuthenticateResult.Fail("not authenticated"))); 108.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 134.Returns(Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "custom")))); 152authenticateResultFeature.AuthenticateResult = AuthenticateResult.Success(newTicket); 250public Task<AuthenticateResult> AuthenticateAsync() 292public Task<AuthenticateResult> AuthenticateAsync() 333public Task<AuthenticateResult> AuthenticateAsync()
CertificateTests.cs (1)
823var authenticationResult = await context.AuthenticateAsync();
CookieTests.cs (5)
1669var result = await context.AuthenticateAsync("Cookies"); 1850await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, new AuthenticationProperties(), CookieAuthenticationDefaults.AuthenticationScheme))); 1854var ticket = await context.AuthenticateAsync(remainder.Value.Substring(1)); 1863var result = await context.AuthenticateAsync(CookieAuthenticationDefaults.AuthenticationScheme); // this used to be "Automatic" 1886private static Task DescribeAsync(HttpResponse res, AuthenticateResult result)
DynamicSchemeTests.cs (3)
115protected override Task<AuthenticateResult> HandleAuthenticateAsync() 125return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 151var result = await context.AuthenticateAsync(name);
GoogleTests.cs (7)
353var result = await context.AuthenticateAsync("Google"); 1166var result = await context.AuthenticateAsync(TestExtensions.CookieAuthenticationScheme); 1176var result = await context.AuthenticateAsync(TestExtensions.CookieAuthenticationScheme); 1181var result = await context.AuthenticateAsync("Google"); 1186var result = await context.AuthenticateAsync("Facebook"); 1192var result = await context.AuthenticateAsync("Google"); 1197var result = await context.AuthenticateAsync("Google");
JwtBearerTests.cs (3)
1176var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); // this used to be "Automatic" 1212var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1230var authenticationResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
JwtBearerTests_Handler.cs (3)
1243var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); // this used to be "Automatic" 1279var result = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme); 1297var authenticationResult = await context.AuthenticateAsync(JwtBearerDefaults.AuthenticationScheme);
PolicyTests.cs (5)
370public Task<AuthenticateResult> AuthenticateAsync() 377return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 420public Task<AuthenticateResult> AuthenticateAsync() 427return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 477var result = await context.AuthenticateAsync(name);
TestHandlers.cs (4)
35protected override Task<AuthenticateResult> HandleAuthenticateAsync() 42return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name))); 67public Task<AuthenticateResult> AuthenticateAsync() 74return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, new AuthenticationProperties(), Scheme.Name)));
TwitterTests.cs (1)
565var result = await context.AuthenticateAsync(TestExtensions.CookieAuthenticationScheme);
Microsoft.AspNetCore.Authorization.Policy (19)
AuthenticationFeatures.cs (3)
16private AuthenticateResult? _result; 18public AuthenticationFeatures(AuthenticateResult result) 23public AuthenticateResult? AuthenticateResult
AuthorizationMiddleware.cs (1)
156var authenticateResult = await policyEvaluator.AuthenticateAsync(policy, context);
IPolicyEvaluator.cs (4)
21/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> fail to authenticate. </returns> 22Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context); 35/// Otherwise returns <see cref="PolicyAuthorizationResult.Forbid(AuthorizationFailure)"/> if <see cref="AuthenticateResult.Succeeded"/>, otherwise 37Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource);
PolicyAuthorizationResult.cs (1)
7/// The result of <see cref="IPolicyEvaluator.AuthorizeAsync(AuthorizationPolicy, Authentication.AuthenticateResult, Http.HttpContext, object?)"/>.
PolicyEvaluator.cs (10)
33/// <returns><see cref="AuthenticateResult.Success"/> unless all schemes specified by <see cref="AuthorizationPolicy.AuthenticationSchemes"/> failed to authenticate. </returns> 34public virtual async Task<AuthenticateResult> AuthenticateAsync(AuthorizationPolicy policy, HttpContext context) 42var result = await context.AuthenticateAsync(scheme); 61return AuthenticateResult.Success(ticket); 66return AuthenticateResult.NoResult(); 73static AuthenticateResult DefaultAuthenticateResult(HttpContext context) 76? AuthenticateResult.Success(new AuthenticationTicket(context.User, "context.User")) 77: AuthenticateResult.NoResult(); 92/// Otherwise returns <see cref="PolicyAuthorizationResult.Forbid(AuthorizationFailure)"/> if <see cref="AuthenticateResult.Succeeded"/>, otherwise 94public virtual async Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object? resource)
Microsoft.AspNetCore.Authorization.Test (28)
AuthorizationMiddlewareTests.cs (12)
829var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 836var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 904authenticateResultFeature.AuthenticateResult = AuthenticateResult.Success(newTicket); 910public AuthenticateResult AuthenticateResult { get; set; } 925var res = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(c.User.Identities.FirstOrDefault(i => i.AuthenticationType == scheme)), scheme)); 932var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "")); 958var authenticateResult = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), ""));
PolicyEvaluatorTests.cs (13)
24var result = await evaluator.AuthenticateAsync(policy, context); 41var result = await evaluator.AuthenticateAsync(policy, context); 60var result = await evaluator.AuthenticateAsync(policy, context); 77var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Fail("Nooo"), context, resource: null); 92var success = AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "whatever")); 112var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Fail("Nooo"), context, resource: null); 129var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "scheme")), context, resource: null); 149var result = await evaluator.AuthorizeAsync(policy, AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(), "scheme")), context, resource: null); 189public Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string scheme) 190=> Task.FromResult(AuthenticateResult.Fail("Sad.")); 209public Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string scheme) 212return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(Principal, scheme)));
TestObjects\TestAuthenticationService.cs (3)
20public Task<AuthenticateResult> AuthenticateAsync(HttpContext context, string scheme) 27return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(identity), scheme))); 30return Task.FromResult(AuthenticateResult.Fail("Denied"));
Microsoft.AspNetCore.Identity (5)
IdentityServiceCollectionExtensions.cs (1)
192protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
SignInManager.cs (4)
164var auth = await Context.AuthenticateAsync(AuthenticationScheme); 439var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorRememberMeScheme); 689var auth = await Context.AuthenticateAsync(IdentityConstants.ExternalScheme); 866var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme);
Microsoft.AspNetCore.Identity.InMemory.Test (5)
ControllerTest.cs (1)
80auth.Setup(a => a.AuthenticateAsync(context, It.IsAny<string>())).Returns(Task.FromResult(AuthenticateResult.NoResult()));
FunctionalTest.cs (4)
355var result = await context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme); 360await DescribeAsync(res, AuthenticateResult.Success(new AuthenticationTicket(context.User, null, "Application"))); 364var auth = await context.AuthenticateAsync(remainder.Value.Substring(1)); 405private static async Task DescribeAsync(HttpResponse res, AuthenticateResult result)
Microsoft.AspNetCore.Identity.Test (19)
SecurityStampValidatorTest.cs (1)
21public Task<AuthenticateResult> AuthenticateAsync()
SignInManagerTest.cs (18)
217.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), null, IdentityConstants.TwoFactorRememberMeScheme))).Verifiable(); 376.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 417.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 456.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 546.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 615var authResult = AuthenticateResult.NoResult(); 701.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 736.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 793.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(id), null, IdentityConstants.TwoFactorRememberMeScheme))).Verifiable(); 1041var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1072var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1104var authResult = AuthenticateResult.Success(new AuthenticationTicket(principal, properties, "blah")); 1202.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable(); 1268.ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(id, null, IdentityConstants.TwoFactorUserIdScheme))).Verifiable();
Microsoft.AspNetCore.Mvc.Core (1)
Authorization\AuthorizeFilter.cs (1)
177var authenticateResult = await policyEvaluator.AuthenticateAsync(effectivePolicy, context.HttpContext);
Microsoft.AspNetCore.Mvc.Core.Test (3)
Authorization\AuthorizeFilterTest.cs (3)
612auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Bearer")).ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(bearerPrincipal, "Bearer"))); 613auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Basic")).ReturnsAsync(AuthenticateResult.Success(new AuthenticationTicket(basicPrincipal, "Basic"))); 614auth.Setup(c => c.AuthenticateAsync(httpContext.Object, "Fails")).ReturnsAsync(AuthenticateResult.Fail("Fails"));
Microsoft.AspNetCore.Server.HttpSys (3)
AuthenticationHandler.cs (3)
14public Task<AuthenticateResult> AuthenticateAsync() 19return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_requestContext.User!, properties: null, authenticationScheme: _scheme!.Name))); 21return Task.FromResult(AuthenticateResult.NoResult());
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
AuthenticationTests.cs (3)
208var authResults = await httpContext.AuthenticateAsync(HttpSysDefaults.AuthenticationScheme); 232var authResults = await httpContext.AuthenticateAsync(HttpSysDefaults.AuthenticationScheme); 391var authenticateResult = await httpContext.AuthenticateAsync(HttpSysDefaults.AuthenticationScheme);
Microsoft.AspNetCore.Server.IIS (3)
Core\IISServerAuthenticationHandlerInternal.cs (3)
22public Task<AuthenticateResult> AuthenticateAsync() 30return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(user, Scheme.Name))); 34return Task.FromResult(AuthenticateResult.NoResult());
Microsoft.AspNetCore.Server.IISIntegration (3)
AuthenticationHandler.cs (3)
17public Task<AuthenticateResult> AuthenticateAsync() 23return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_user, _scheme.Name))); 27return Task.FromResult(AuthenticateResult.NoResult());
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
2859protected override Task<AuthenticateResult> HandleAuthenticateAsync() 2866return Task.FromResult(AuthenticateResult.Success(
OpenIdConnectSample (1)
Startup.cs (1)
209var userResult = await context.AuthenticateAsync();
PathSchemeSelection (2)
Startup.cs (2)
51protected override Task<AuthenticateResult> HandleAuthenticateAsync() 52=> Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(_id, "Api")));
SecurityWebSite (1)
CountingPolicyEvaluator.cs (1)
16public override Task<PolicyAuthorizationResult> AuthorizeAsync(AuthorizationPolicy policy, AuthenticateResult authenticationResult, HttpContext context, object resource)
SocialSample (1)
Startup.cs (1)
283var userResult = await context.AuthenticateAsync();