1 write to Context
Microsoft.AspNetCore.Authentication (1)
163 references to Context
Aspire.Dashboard (7)
Microsoft.AspNetCore.Authentication (20)
RemoteAuthenticationHandler.cs (9)
83return await RemoteAuthenticationAntiforgery.HandleWithoutAntiforgeryVerdictAsync(Context, HandleRequestCoreAsync);
122var errorContext = new RemoteFailureContext(Context, Scheme, Options, exception)
152var ticketContext = new TicketReceivedContext(Context, Scheme, Options, ticket)
178await Context.SignInAsync(SignInScheme, ticketContext.Principal!, ticketContext.Properties);
200var result = await Context.AuthenticateAsync(SignInScheme);
226=> Context.ForbidAsync(SignInScheme);
240var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow());
276var cookieOptions = Options.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow());
297var context = new AccessDeniedContext(Context, Scheme, Options)
Microsoft.AspNetCore.Authentication.BearerToken (3)
Microsoft.AspNetCore.Authentication.Certificate (9)
CertificateAuthenticationHandler.cs (9)
46_cache = Context.RequestServices.GetService<ICertificateValidationCache>();
53if (!Context.Request.IsHttps)
61var clientCertificate = await Context.Connection.GetClientCertificateAsync();
72Context.Items[CertificateSchemeCacheKeyItem] = Scheme.Name;
73var cacheHit = _cache.Get(Context, clientCertificate);
92_cache?.Put(Context, clientCertificate, result);
109var authenticationFailedContext = new CertificateAuthenticationFailedContext(Context, Scheme, Options)
172var certificateValidatedContext = new CertificateValidatedContext(Context, Scheme, Options)
191var authenticationChallengedContext = new CertificateChallengeContext(Context, Scheme, Options, properties);
Microsoft.AspNetCore.Authentication.Cookies (27)
CookieAuthenticationHandler.cs (27)
73Context.Response.OnStarting(FinishResponseAsync);
104var eventContext = new CookieSlidingExpirationContext(Context, Scheme, Options, ticket, timeElapsed, timeRemaining)
153var cookie = Options.CookieManager.GetRequestCookie(Context, Options.Cookie.Name!);
173ticket = await Options.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted);
188await Options.SessionStore.RemoveAsync(_sessionKey!, Context, Context.RequestAborted);
214var context = new CookieValidatePrincipalContext(Context, Scheme, Options, result.Ticket);
232var cookieOptions = Options.Cookie.Build(Context);
265await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
282Context,
305Context,
343await Options.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
347_sessionKey = await Options.SessionStore.StoreAsync(ticket, Context, Context.RequestAborted);
360Context,
366Context,
393await Options.SessionStore.RemoveAsync(_sessionKey, Context, Context.RequestAborted);
402Context,
411Context,
449new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, redirectUri));
468var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, BuildRedirectUri(accessDeniedUri));
482var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme, Options, properties, BuildRedirectUri(loginUri));
489var binding = Context.Features.Get<ITlsTokenBindingFeature>()?.GetProvidedTokenBindingId();
Microsoft.AspNetCore.Authentication.DeviceBoundSessions (10)
DeviceBoundSessionHandler.cs (10)
109var authResult = await Context.AuthenticateAsync(Options.RegistrationSourceScheme);
147await Context.SignInAsync(Options.RefreshScheme, principal, refreshProperties);
157await Context.SignInAsync(Options.SessionScheme, principal, sessionProperties);
162Context.Items[DeviceBoundSessionCookieEvents.RegistrationExchangeItemKey] = true;
163await Context.SignOutAsync(Options.RegistrationSourceScheme);
171await JsonSerializer.SerializeAsync(Response.Body, instructions, DeviceBoundSessionJsonContext.Default.SessionInstruction, Context.RequestAborted);
187var authResult = await Context.AuthenticateAsync(Options.RefreshScheme);
262await Context.SignInAsync(Options.SessionScheme, authResult.Principal, sessionProperties);
275await JsonSerializer.SerializeAsync(Response.Body, instructions, DeviceBoundSessionJsonContext.Default.SessionInstruction, Context.RequestAborted);
335var cookie = cookieOptions.Cookie.Build(Context);
Microsoft.AspNetCore.Authentication.Facebook (3)
Microsoft.AspNetCore.Authentication.Google (3)
Microsoft.AspNetCore.Authentication.JwtBearer (7)
JwtBearerHandler.cs (7)
62var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options);
153var tokenValidatedContext = new TokenValidatedContext(Context, Scheme, Options)
182var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme, Options)
207var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme, Options)
253var configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
278var eventContext = new JwtBearerChallengeContext(Context, Scheme, Options, properties)
351var forbiddenContext = new ForbiddenContext(Context, Scheme, Options);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (3)
Microsoft.AspNetCore.Authentication.Negotiate (9)
NegotiateHandler.cs (9)
166Context.Response.StatusCode = StatusCodes.Status400BadRequest;
268var errorContext = new AuthenticationFailedContext(Context, Scheme, Options) { Exception = ex };
339var ldapContext = new LdapContext(Context, Scheme, Options, Options.LdapSettings)
353authenticatedContext = new AuthenticatedContext(Context, Scheme, Options)
360authenticatedContext = new AuthenticatedContext(Context, Scheme, Options)
386var eventContext = new ChallengeContext(Context, Scheme, Options, properties);
409return Context.Features.Get<IConnectionItemsFeature>()?.Items
416Context.Features.Get<ITlsConnectionFeature>() is { } tlsConnectionFeature &&
427var connectionCompleteFeature = Context.Features.Get<IConnectionCompleteFeature>()
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.Authentication.OpenIdConnect (32)
OpenIdConnectHandler.cs (32)
97return RemoteAuthenticationAntiforgery.HandleWithoutAntiforgeryVerdictAsync(Context, HandleRemoteSignOutAsync);
101return RemoteAuthenticationAntiforgery.HandleWithoutAntiforgeryVerdictAsync(Context, HandleSignOutCallbackAsync);
132var form = await Request.ReadFormAsync(Context.RequestAborted);
140var remoteSignOutContext = new RemoteSignOutContext(Context, Scheme, Options, message);
170var principal = (await Context.AuthenticateAsync(Options.SignOutScheme))?.Principal;
209await Context.SignOutAsync(Options.SignOutScheme);
222await Context.SignOutAsync(target, properties);
232_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
256message.IdTokenHint = await Context.GetTokenAsync(Options.SignOutScheme, OpenIdConnectParameterNames.IdToken);
258var redirectContext = new RedirectContext(Context, Scheme, Options, properties)
334var signOut = new RemoteSignOutContext(Context, Scheme, Options, message)
374var location = Context.Response.Headers.Location;
380var cookie = Context.Response.Headers.SetCookie;
404_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
467var redirectContext = new RedirectContext(Context, Scheme, Options, properties)
567var context = new PushedAuthorizationContext(Context, Scheme, Options, parRequest, properties);
604var parResponseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted);
623var parResponseString = await parResponseMessage.Content.ReadAsStringAsync(Context.RequestAborted);
671var form = await Request.ReadFormAsync(Context.RequestAborted);
760_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
1000var responseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted);
1022var responseContent = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted);
1066var responseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted);
1068var userInfoResponse = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted);
1168var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow());
1200var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow());
1218var context = new MessageReceivedContext(Context, Scheme, Options, properties)
1241var context = new TokenValidatedContext(Context, Scheme, Options, user, properties)
1286var context = new AuthorizationCodeReceivedContext(Context, Scheme, Options, properties)
1318var context = new TokenResponseReceivedContext(Context, Scheme, Options, user, properties)
1344var context = new UserInformationReceivedContext(Context, Scheme, Options, principal, properties)
1368var context = new AuthenticationFailedContext(Context, Scheme, Options)
Microsoft.AspNetCore.Authentication.Twitter (9)
Microsoft.AspNetCore.Authentication.WsFederation (13)
WsFederationHandler.cs (13)
89_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
116var redirectContext = new RedirectContext(Context, Scheme, Options, properties)
160var form = await Request.ReadFormAsync(Context.RequestAborted);
201var messageReceivedContext = new MessageReceivedContext(Context, Scheme, Options, properties)
233var securityTokenReceivedContext = new SecurityTokenReceivedContext(Context, Scheme, Options, properties)
333var securityTokenValidatedContext = new SecurityTokenValidatedContext(Context, Scheme, Options, principal, properties)
356var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme, Options)
386_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
416await Context.SignOutAsync(target, properties);
422_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
449var redirectContext = new RedirectContext(Context, Scheme, Options, properties)
477var remoteSignOutContext = new RemoteSignOutContext(Context, Scheme, Options, message);
496await Context.SignOutAsync(Options.SignOutScheme);
Microsoft.AspNetCore.Identity (2)