1 write to Context
Microsoft.AspNetCore.Authentication (1)
AuthenticationHandler.cs (1)
153
Context
= context;
138 references to Context
Aspire.Dashboard (2)
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (1)
18
var connectionTypeFeature =
Context
.Features.Get<IConnectionTypeFeature>();
Authentication\OtlpApiKey\OtlpApiKeyAuthenticationHandler.cs (1)
26
if (
Context
.Request.Headers.TryGetValue(ApiKeyHeaderName, out var apiKey))
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.Certificate (8)
CertificateAuthenticationHandler.cs (8)
44
_cache =
Context
.RequestServices.GetService<ICertificateValidationCache>();
51
if (!
Context
.Request.IsHttps)
59
var clientCertificate = await
Context
.Connection.GetClientCertificateAsync();
70
var cacheHit = _cache.Get(
Context
, clientCertificate);
89
_cache?.Put(
Context
, clientCertificate, result);
106
var authenticationFailedContext = new CertificateAuthenticationFailedContext(
Context
, Scheme, Options)
155
var certificateValidatedContext = new CertificateValidatedContext(
Context
, Scheme, Options)
174
var authenticationChallengedContext = new CertificateChallengeContext(
Context
, Scheme, Options, properties);
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.Facebook (3)
FacebookHandler.cs (3)
52
var response = await Backchannel.GetAsync(endpoint,
Context
.RequestAborted);
58
using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(
Context
.RequestAborted)))
60
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties,
Context
, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Google (3)
GoogleHandler.cs (3)
50
var response = await Backchannel.SendAsync(request,
Context
.RequestAborted);
56
using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(
Context
.RequestAborted)))
58
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties,
Context
, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.JwtBearer (7)
JwtBearerHandler.cs (7)
62
var messageReceivedContext = new MessageReceivedContext(
Context
, Scheme, Options);
153
var tokenValidatedContext = new TokenValidatedContext(
Context
, Scheme, Options)
182
var authenticationFailedContext = new AuthenticationFailedContext(
Context
, Scheme, Options)
207
var authenticationFailedContext = new AuthenticationFailedContext(
Context
, Scheme, Options)
253
var configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
278
var eventContext = new JwtBearerChallengeContext(
Context
, Scheme, Options, properties)
351
var forbiddenContext = new ForbiddenContext(
Context
, Scheme, Options);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (3)
MicrosoftAccountHandler.cs (3)
46
var response = await Backchannel.SendAsync(request,
Context
.RequestAborted);
52
using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(
Context
.RequestAborted)))
54
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties,
Context
, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Negotiate (8)
NegotiateHandler.cs (8)
167
Context
.Response.StatusCode = StatusCodes.Status400BadRequest;
269
var errorContext = new AuthenticationFailedContext(
Context
, Scheme, Options) { Exception = ex };
340
var ldapContext = new LdapContext(
Context
, Scheme, Options, Options.LdapSettings)
354
authenticatedContext = new AuthenticatedContext(
Context
, Scheme, Options)
361
authenticatedContext = new AuthenticatedContext(
Context
, Scheme, Options)
387
var eventContext = new ChallengeContext(
Context
, Scheme, Options, properties);
410
return
Context
.Features.Get<IConnectionItemsFeature>()?.Items
416
var connectionCompleteFeature =
Context
.Features.Get<IConnectionCompleteFeature>()
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.Authentication.OpenIdConnect (30)
OpenIdConnectHandler.cs (30)
123
var form = await Request.ReadFormAsync(
Context
.RequestAborted);
131
var remoteSignOutContext = new RemoteSignOutContext(
Context
, Scheme, Options, message);
161
var principal = (await
Context
.AuthenticateAsync(Options.SignOutScheme))?.Principal;
200
await
Context
.SignOutAsync(Options.SignOutScheme);
213
await
Context
.SignOutAsync(target, properties);
223
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
247
message.IdTokenHint = await
Context
.GetTokenAsync(Options.SignOutScheme, OpenIdConnectParameterNames.IdToken);
249
var redirectContext = new RedirectContext(
Context
, Scheme, Options, properties)
325
var signOut = new RemoteSignOutContext(
Context
, Scheme, Options, message)
365
var location =
Context
.Response.Headers.Location;
371
var cookie =
Context
.Response.Headers.SetCookie;
395
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
458
var redirectContext = new RedirectContext(
Context
, Scheme, Options, properties)
557
var context = new PushedAuthorizationContext(
Context
, Scheme, Options, parRequest, properties);
599
var parResponseMessage = await Backchannel.SendAsync(requestMessage,
Context
.RequestAborted);
618
var parResponseString = await parResponseMessage.Content.ReadAsStringAsync(
Context
.RequestAborted);
666
var form = await Request.ReadFormAsync(
Context
.RequestAborted);
755
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
994
var responseMessage = await Backchannel.SendAsync(requestMessage,
Context
.RequestAborted);
1016
var responseContent = await responseMessage.Content.ReadAsStringAsync(
Context
.RequestAborted);
1060
var responseMessage = await Backchannel.SendAsync(requestMessage,
Context
.RequestAborted);
1062
var userInfoResponse = await responseMessage.Content.ReadAsStringAsync(
Context
.RequestAborted);
1162
var cookieOptions = Options.NonceCookie.Build(
Context
, TimeProvider.GetUtcNow());
1193
var cookieOptions = Options.NonceCookie.Build(
Context
, TimeProvider.GetUtcNow());
1211
var context = new MessageReceivedContext(
Context
, Scheme, Options, properties)
1234
var context = new TokenValidatedContext(
Context
, Scheme, Options, user, properties)
1279
var context = new AuthorizationCodeReceivedContext(
Context
, Scheme, Options, properties)
1311
var context = new TokenResponseReceivedContext(
Context
, Scheme, Options, user, properties)
1337
var context = new UserInformationReceivedContext(
Context
, Scheme, Options, principal, properties)
1361
var context = new AuthenticationFailedContext(
Context
, Scheme, Options)
Microsoft.AspNetCore.Authentication.Twitter (9)
TwitterHandler.cs (9)
101
var cookieOptions = Options.StateCookie.Build(
Context
, TimeProvider.GetUtcNow());
157
var context = new TwitterCreatingTicketContext(
Context
, Scheme, Options, new ClaimsPrincipal(identity), properties, token.UserId, token.ScreenName, token.Token, token.TokenSecret, user);
175
var cookieOptions = Options.StateCookie.Build(
Context
, TimeProvider.GetUtcNow());
179
var redirectContext = new RedirectContext<TwitterOptions>(
Context
, Scheme, Options, properties, twitterAuthenticationEndpoint);
266
return await Backchannel.SendAsync(request,
Context
.RequestAborted);
275
var responseText = await response.Content.ReadAsStringAsync(
Context
.RequestAborted);
307
var responseText = await response.Content.ReadAsStringAsync(
Context
.RequestAborted);
331
var responseText = await response.Content.ReadAsStringAsync(
Context
.RequestAborted);
370
var errorContentStream = await response.Content.ReadAsStreamAsync(
Context
.RequestAborted);
Microsoft.AspNetCore.Authentication.WsFederation (13)
WsFederationHandler.cs (13)
89
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
116
var redirectContext = new RedirectContext(
Context
, Scheme, Options, properties)
160
var form = await Request.ReadFormAsync(
Context
.RequestAborted);
201
var messageReceivedContext = new MessageReceivedContext(
Context
, Scheme, Options, properties)
233
var securityTokenReceivedContext = new SecurityTokenReceivedContext(
Context
, Scheme, Options, properties)
333
var securityTokenValidatedContext = new SecurityTokenValidatedContext(
Context
, Scheme, Options, principal, properties)
356
var authenticationFailedContext = new AuthenticationFailedContext(
Context
, Scheme, Options)
386
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
416
await
Context
.SignOutAsync(target, properties);
422
_configuration = await Options.ConfigurationManager.GetConfigurationAsync(
Context
.RequestAborted);
449
var redirectContext = new RedirectContext(
Context
, Scheme, Options, properties)
477
var remoteSignOutContext = new RemoteSignOutContext(
Context
, Scheme, Options, message);
496
await
Context
.SignOutAsync(Options.SignOutScheme);