1 write to Context
Microsoft.AspNetCore.Authentication (1)
AuthenticationHandler.cs (1)
153Context = context;
72 references to Context
Aspire.Dashboard (15)
Api\ApiAuthenticationHandler.cs (6)
58if (Context.Request.Headers.TryGetValue(ApiKeyHeaderName, out var apiKeyHeader)) 94var frontendResult = await Context.AuthenticateAsync(FrontendCompositeAuthenticationDefaults.AuthenticationScheme).ConfigureAwait(false); 112if (Context.Request.Headers.ContainsKey(ApiKeyHeaderName)) 114Context.Response.StatusCode = StatusCodes.Status401Unauthorized; 129return Context.ChallengeAsync(scheme); 132Context.Response.StatusCode = StatusCodes.Status401Unauthorized;
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (1)
18var connectionTypeFeature = Context.Features.Get<IConnectionTypeFeature>();
Authentication\FrontendCompositeAuthenticationHandler.cs (3)
21var result = await Context.AuthenticateAsync(ConnectionTypeAuthenticationDefaults.AuthenticationSchemeFrontend).ConfigureAwait(false); 31result = await Context.AuthenticateAsync().ConfigureAwait(false); 40await Context.ChallengeAsync(scheme).ConfigureAwait(false);
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (1)
26if (Context.Request.Headers.TryGetValue(ApiKeyHeaderName, out var apiKey))
Authentication\OtlpCompositeAuthenticationHandler.cs (1)
28var result = await Context.AuthenticateAsync(scheme).ConfigureAwait(false);
Mcp\McpApiKeyAuthenticationHandler.cs (2)
39if (Context.Request.Headers.TryGetValue(ApiAuthenticationHandler.ApiKeyHeaderName, out apiKey)) 43else if (Context.Request.Headers.TryGetValue(McpApiKeyHeaderName, out apiKey))
Mcp\McpCompositeAuthenticationHandler.cs (1)
26var result = await Context.AuthenticateAsync(scheme).ConfigureAwait(false);
Microsoft.AspNetCore.Authentication (19)
AuthenticationHandler.cs (9)
40get => Context.Request; 48get => Context.Response; 54protected PathString OriginalPath => Context.Features.Get<IAuthenticationFeature>()?.OriginalPath ?? Request.Path; 59protected PathString OriginalPathBase => Context.Features.Get<IAuthenticationFeature>()?.OriginalPathBase ?? Request.PathBase; 174Events = Context.RequestServices.GetRequiredService(Options.EventsType); 206var target = scheme ?? Options.ForwardDefaultSelector?.Invoke(Context) ?? Options.ForwardDefault; 220return await Context.AuthenticateAsync(target); 311await Context.ChallengeAsync(target, properties); 326await Context.ForbidAsync(target, properties);
RemoteAuthenticationHandler.cs (8)
116var errorContext = new RemoteFailureContext(Context, Scheme, Options, exception) 146var ticketContext = new TicketReceivedContext(Context, Scheme, Options, ticket) 172await Context.SignInAsync(SignInScheme, ticketContext.Principal!, ticketContext.Properties); 194var result = await Context.AuthenticateAsync(SignInScheme); 220=> Context.ForbidAsync(SignInScheme); 234var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow()); 269var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow()); 290var context = new AccessDeniedContext(Context, Scheme, Options)
SignInAuthenticationHandler.cs (1)
42? Context.SignInAsync(target, user, properties)
SignOutAuthenticationHandler.cs (1)
41? Context.SignOutAsync(target, properties)
Microsoft.AspNetCore.Authentication.BearerToken (3)
BearerTokenHandler.cs (3)
27var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options); 80await Context.Response.WriteAsJsonAsync(response, ResolveAccessTokenJsonTypeInfo(Context));
Microsoft.AspNetCore.Authentication.Cookies (27)
CookieAuthenticationHandler.cs (27)
72Context.Response.OnStarting(FinishResponseAsync); 103var eventContext = new CookieSlidingExpirationContext(Context, Scheme, Options, ticket, timeElapsed, timeRemaining) 152var cookie = Options.CookieManager.GetRequestCookie(Context, Options.Cookie.Name!); 172ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted); 187await Options.SessionStore.RemoveAsync(_sessionKey!, Context, Context.RequestAborted); 213var context = new CookieValidatePrincipalContext(Context, Scheme, Options, result.Ticket); 231var cookieOptions = Options.Cookie.Build(Context); 264await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted); 281Context, 304Context, 342await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted); 346_sessionKey = await Options.SessionStore.StoreAsync(ticket, Context, Context.RequestAborted); 359Context, 365Context, 392await Options.SessionStore.RemoveAsync(_sessionKey, Context, Context.RequestAborted); 396Context, 405Context, 443new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, redirectUri)); 470var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, BuildRedirectUri(accessDeniedUri)); 484var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, BuildRedirectUri(loginUri)); 490var binding = Context.Features.Get<ITlsTokenBindingFeature>()?.GetProvidedTokenBindingId();
Microsoft.AspNetCore.Authentication.OAuth (6)
OAuthHandler.cs (6)
222var response = await Backchannel.SendAsync(requestMessage, Context.RequestAborted); 223var body = await response.Content.ReadAsStringAsync(Context.RequestAborted); 256var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, user.RootElement); 275Context, Scheme, Options, 279var location = Context.Response.Headers.Location; 285var cookie = Context.Response.Headers.SetCookie;
Microsoft.AspNetCore.Identity (2)
IdentityServiceCollectionExtensions.cs (2)
196var bearerResult = await Context.AuthenticateAsync(IdentityConstants.BearerScheme); 205return await Context.AuthenticateAsync(IdentityConstants.ApplicationScheme);