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