1 write to Context
Microsoft.AspNetCore.Authentication (1)
AuthenticationHandler.cs (1)
153Context = context;
147 references to Context
Aspire.Dashboard (6)
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);
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.Certificate (8)
CertificateAuthenticationHandler.cs (8)
44_cache = Context.RequestServices.GetService<ICertificateValidationCache>(); 51if (!Context.Request.IsHttps) 59var clientCertificate = await Context.Connection.GetClientCertificateAsync(); 70var cacheHit = _cache.Get(Context, clientCertificate); 89_cache?.Put(Context, clientCertificate, result); 106var authenticationFailedContext = new CertificateAuthenticationFailedContext(Context, Scheme, Options) 155var certificateValidatedContext = new CertificateValidatedContext(Context, Scheme, Options) 174var authenticationChallengedContext = new CertificateChallengeContext(Context, Scheme, Options, properties);
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.Facebook (3)
FacebookHandler.cs (3)
52var response = await Backchannel.GetAsync(endpoint, Context.RequestAborted); 58using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted))) 60var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Google (3)
GoogleHandler.cs (3)
50var response = await Backchannel.SendAsync(request, Context.RequestAborted); 56using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted))) 58var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
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)
MicrosoftAccountHandler.cs (3)
46var response = await Backchannel.SendAsync(request, Context.RequestAborted); 52using (var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted))) 54var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement);
Microsoft.AspNetCore.Authentication.Negotiate (8)
NegotiateHandler.cs (8)
164Context.Response.StatusCode = StatusCodes.Status400BadRequest; 266var errorContext = new AuthenticationFailedContext(Context, Scheme, Options) { Exception = ex }; 337var ldapContext = new LdapContext(Context, Scheme, Options, Options.LdapSettings) 351authenticatedContext = new AuthenticatedContext(Context, Scheme, Options) 358authenticatedContext = new AuthenticatedContext(Context, Scheme, Options) 384var eventContext = new ChallengeContext(Context, Scheme, Options, properties); 407return Context.Features.Get<IConnectionItemsFeature>()?.Items 413var 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 (30)
OpenIdConnectHandler.cs (30)
123var form = await Request.ReadFormAsync(Context.RequestAborted); 131var remoteSignOutContext = new RemoteSignOutContext(Context, Scheme, Options, message); 161var principal = (await Context.AuthenticateAsync(Options.SignOutScheme))?.Principal; 200await Context.SignOutAsync(Options.SignOutScheme); 213await Context.SignOutAsync(target, properties); 223_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); 247message.IdTokenHint = await Context.GetTokenAsync(Options.SignOutScheme, OpenIdConnectParameterNames.IdToken); 249var redirectContext = new RedirectContext(Context, Scheme, Options, properties) 325var signOut = new RemoteSignOutContext(Context, Scheme, Options, message) 365var location = Context.Response.Headers.Location; 371var cookie = Context.Response.Headers.SetCookie; 395_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); 458var redirectContext = new RedirectContext(Context, Scheme, Options, properties) 558var context = new PushedAuthorizationContext(Context, Scheme, Options, parRequest, properties); 595var parResponseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted); 614var parResponseString = await parResponseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 662var form = await Request.ReadFormAsync(Context.RequestAborted); 751_configuration = await Options.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted); 990var responseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted); 1012var responseContent = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1056var responseMessage = await Backchannel.SendAsync(requestMessage, Context.RequestAborted); 1058var userInfoResponse = await responseMessage.Content.ReadAsStringAsync(Context.RequestAborted); 1158var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow()); 1189var cookieOptions = Options.NonceCookie.Build(Context, TimeProvider.GetUtcNow()); 1207var context = new MessageReceivedContext(Context, Scheme, Options, properties) 1230var context = new TokenValidatedContext(Context, Scheme, Options, user, properties) 1275var context = new AuthorizationCodeReceivedContext(Context, Scheme, Options, properties) 1307var context = new TokenResponseReceivedContext(Context, Scheme, Options, user, properties) 1333var context = new UserInformationReceivedContext(Context, Scheme, Options, principal, properties) 1357var context = new AuthenticationFailedContext(Context, Scheme, Options)
Microsoft.AspNetCore.Authentication.Twitter (9)
TwitterHandler.cs (9)
101var cookieOptions = Options.StateCookie.Build(Context, TimeProvider.GetUtcNow()); 157var context = new TwitterCreatingTicketContext(Context, Scheme, Options, new ClaimsPrincipal(identity), properties, token.UserId, token.ScreenName, token.Token, token.TokenSecret, user); 175var cookieOptions = Options.StateCookie.Build(Context, TimeProvider.GetUtcNow()); 179var redirectContext = new RedirectContext<TwitterOptions>(Context, Scheme, Options, properties, twitterAuthenticationEndpoint); 266return await Backchannel.SendAsync(request, Context.RequestAborted); 275var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 307var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 331var responseText = await response.Content.ReadAsStringAsync(Context.RequestAborted); 370var errorContentStream = await response.Content.ReadAsStreamAsync(Context.RequestAborted);
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)
IdentityServiceCollectionExtensions.cs (2)
194var bearerResult = await Context.AuthenticateAsync(IdentityConstants.BearerScheme); 203return await Context.AuthenticateAsync(IdentityConstants.ApplicationScheme);