1 write to Options
Microsoft.AspNetCore.Authentication (1)
AuthenticationHandler.cs (1)
155
Options
= OptionsMonitor.Get(Scheme.Name);
314 references to Options
Aspire.Dashboard (2)
Authentication\Connection\ConnectionTypeAuthenticationHandler.cs (2)
25
if (!connectionTypeFeature.ConnectionTypes.Contains(
Options
.RequiredConnectionType))
27
return Task.FromResult(AuthenticateResult.Fail($"Connection type {
Options
.RequiredConnectionType} is not enabled on this connection."));
Identity.DefaultUI.WebSite (2)
Services\ContosoAuthenticationHandler.cs (2)
27
var uri = $"{Request.Scheme}://{Request.Host}{Request.PathBase}{
Options
.RemoteLoginPath}";
31
[
Options
.ReturnUrlQueryParameter] = properties.RedirectUri
Microsoft.AspNetCore.Authentication (24)
AuthenticationHandler.cs (10)
99
protected virtual string ClaimsIssuer =>
Options
.ClaimsIssuer ?? Scheme.Name;
157
TimeProvider =
Options
.TimeProvider ?? TimeProvider.System;
171
Events =
Options
.Events;
172
if (
Options
.EventsType != null)
174
Events = Context.RequestServices.GetRequiredService(
Options
.EventsType);
206
var target = scheme ??
Options
.ForwardDefaultSelector?.Invoke(Context) ??
Options
.ForwardDefault;
217
var target = ResolveTarget(
Options
.ForwardAuthenticate);
308
var target = ResolveTarget(
Options
.ForwardChallenge);
323
var target = ResolveTarget(
Options
.ForwardForbid);
RemoteAuthenticationHandler.cs (12)
28
protected string? SignInScheme =>
Options
.SignInScheme;
69
=> Task.FromResult(
Options
.CallbackPath == Request.Path);
116
var errorContext = new RemoteFailureContext(Context, Scheme,
Options
, exception)
146
var ticketContext = new TicketReceivedContext(Context, Scheme,
Options
, ticket)
234
var cookieOptions =
Options
.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow());
238
var cookieName =
Options
.CorrelationCookie.Name + correlationId;
254
Logger.CorrelationPropertyNotFound(
Options
.CorrelationCookie.Name!);
260
var cookieName =
Options
.CorrelationCookie.Name + correlationId;
269
var cookieOptions =
Options
.CorrelationCookie.Build(Context, TimeProvider.GetUtcNow());
290
var context = new AccessDeniedContext(Context, Scheme,
Options
)
292
AccessDeniedPath =
Options
.AccessDeniedPath,
295
ReturnUrlParameter =
Options
.ReturnUrlParameter
SignInAuthenticationHandler.cs (1)
40
var target = ResolveTarget(
Options
.ForwardSignIn);
SignOutAuthenticationHandler.cs (1)
39
var target = ResolveTarget(
Options
.ForwardSignOut);
Microsoft.AspNetCore.Authentication.Certificate (22)
CertificateAuthenticationHandler.cs (22)
106
var authenticationFailedContext = new CertificateAuthenticationFailedContext(Context, Scheme,
Options
)
122
!
Options
.AllowedCertificateTypes.HasFlag(CertificateTypes.SelfSigned))
131
!
Options
.AllowedCertificateTypes.HasFlag(CertificateTypes.Chained))
155
var certificateValidatedContext = new CertificateValidatedContext(Context, Scheme,
Options
)
174
var authenticationChallengedContext = new CertificateChallengeContext(Context, Scheme,
Options
, properties);
190
X509RevocationFlag revocationFlag =
Options
.RevocationFlag;
191
X509RevocationMode revocationMode =
Options
.RevocationMode;
206
if (
Options
.ValidateCertificateUse)
219
if (
Options
.CustomTrustStore != null)
221
chainPolicy.CustomTrustStore.AddRange(
Options
.CustomTrustStore);
224
chainPolicy.TrustMode =
Options
.ChainTrustValidationMode;
227
chainPolicy.ExtraStore.AddRange(
Options
.AdditionalChainCertificates);
229
if (!
Options
.ValidateValidityPeriod)
242
claims.Add(new Claim("issuer", issuer, ClaimValueTypes.String,
Options
.ClaimsIssuer));
245
claims.Add(new Claim(ClaimTypes.Thumbprint, thumbprint, ClaimValueTypes.Base64Binary,
Options
.ClaimsIssuer));
250
claims.Add(new Claim(ClaimTypes.X500DistinguishedName, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
256
claims.Add(new Claim(ClaimTypes.SerialNumber, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
262
claims.Add(new Claim(ClaimTypes.Dns, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
268
claims.Add(new Claim(ClaimTypes.Name, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
274
claims.Add(new Claim(ClaimTypes.Email, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
280
claims.Add(new Claim(ClaimTypes.Upn, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
286
claims.Add(new Claim(ClaimTypes.Uri, value, ClaimValueTypes.String,
Options
.ClaimsIssuer));
Microsoft.AspNetCore.Authentication.Cookies (46)
CookieAuthenticationHandler.cs (46)
98
if (issuedUtc != null && expiresUtc != null &&
Options
.SlidingExpiration && allowRefresh)
103
var eventContext = new CookieSlidingExpirationContext(Context, Scheme,
Options
, ticket, timeElapsed, timeRemaining)
152
var cookie =
Options
.CookieManager.GetRequestCookie(Context,
Options
.Cookie.Name!);
158
var ticket =
Options
.TicketDataFormat.Unprotect(cookie, GetTlsTokenBinding());
164
if (
Options
.SessionStore != null)
172
ticket = await
Options
.SessionStore.RetrieveAsync(claim.Value, Context, Context.RequestAborted);
185
if (
Options
.SessionStore != null)
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);
262
if (
Options
.SessionStore != null && _sessionKey != null)
264
await
Options
.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
267
new[] { new Claim(SessionIdClaim, _sessionKey, ClaimValueTypes.String,
Options
.ClaimsIssuer) },
272
var cookieValue =
Options
.TicketDataFormat.Protect(ticket, GetTlsTokenBinding());
280
Options
.CookieManager.AppendResponseCookie(
282
Options
.Cookie.Name!,
306
Options
,
324
signInContext.Properties.ExpiresUtc = issuedUtc.Add(
Options
.ExpireTimeSpan);
331
var expiresUtc = signInContext.Properties.ExpiresUtc ?? issuedUtc.Add(
Options
.ExpireTimeSpan);
337
if (
Options
.SessionStore != null)
342
await
Options
.SessionStore.RenewAsync(_sessionKey, ticket, Context, Context.RequestAborted);
346
_sessionKey = await
Options
.SessionStore.StoreAsync(ticket, Context, Context.RequestAborted);
351
new[] { new Claim(SessionIdClaim, _sessionKey, ClaimValueTypes.String,
Options
.ClaimsIssuer) },
352
Options
.ClaimsIssuer));
356
var cookieValue =
Options
.TicketDataFormat.Protect(ticket, GetTlsTokenBinding());
358
Options
.CookieManager.AppendResponseCookie(
360
Options
.Cookie.Name!,
369
Options
);
374
var shouldHonorReturnUrlParameter =
Options
.LoginPath.HasValue && OriginalPath ==
Options
.LoginPath;
390
if (
Options
.SessionStore != null && _sessionKey != null)
392
await
Options
.SessionStore.RemoveAsync(_sessionKey, Context, Context.RequestAborted);
398
Options
,
404
Options
.CookieManager.DeleteCookie(
406
Options
.Cookie.Name!,
410
var shouldHonorReturnUrlParameter =
Options
.LogoutPath.HasValue && OriginalPath ==
Options
.LogoutPath;
433
redirectUri = Request.Query[
Options
.ReturnUrlParameter];
443
new RedirectContext<CookieAuthenticationOptions>(Context, Scheme,
Options
, properties, redirectUri));
469
var accessDeniedUri =
Options
.AccessDeniedPath + QueryString.Create(
Options
.ReturnUrlParameter, returnUrl);
470
var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme,
Options
, properties, BuildRedirectUri(accessDeniedUri));
483
var loginUri =
Options
.LoginPath + QueryString.Create(
Options
.ReturnUrlParameter, redirectUri);
484
var redirectContext = new RedirectContext<CookieAuthenticationOptions>(Context, Scheme,
Options
, properties, BuildRedirectUri(loginUri));
Microsoft.AspNetCore.Authentication.Facebook (6)
FacebookHandler.cs (6)
42
var endpoint = QueryHelpers.AddQueryString(
Options
.UserInformationEndpoint, "access_token", tokens.AccessToken!);
43
if (
Options
.SendAppSecretProof)
47
if (
Options
.Fields.Count > 0)
49
endpoint = QueryHelpers.AddQueryString(endpoint, "fields", string.Join(",",
Options
.Fields));
60
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme,
Options
, Backchannel, tokens, payload.RootElement);
69
var key = Encoding.ASCII.GetBytes(
Options
.AppSecret);
Microsoft.AspNetCore.Authentication.Google (6)
GoogleHandler.cs (6)
47
var request = new HttpRequestMessage(HttpMethod.Get,
Options
.UserInformationEndpoint);
58
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme,
Options
, Backchannel, tokens, payload.RootElement);
74
SetQueryParam(queryStrings, properties, GoogleChallengeProperties.ScopeKey, FormatScope,
Options
.Scope);
75
SetQueryParam(queryStrings, properties, GoogleChallengeProperties.AccessTypeKey,
Options
.AccessType);
82
queryStrings["state"] =
Options
.StateDataFormat.Protect(properties);
84
return QueryHelpers.AddQueryString(
Options
.AuthorizationEndpoint, queryStrings);
Microsoft.AspNetCore.Authentication.JwtBearer (22)
JwtBearerHandler.cs (22)
62
var messageReceivedContext = new MessageReceivedContext(Context, Scheme,
Options
);
101
if (!
Options
.UseSecurityTokenValidators)
103
foreach (var tokenHandler in
Options
.TokenHandlers)
130
foreach (var validator in
Options
.SecurityTokenValidators)
153
var tokenValidatedContext = new TokenValidatedContext(Context, Scheme,
Options
)
168
if (
Options
.SaveToken)
182
var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme,
Options
)
196
if (!
Options
.UseSecurityTokenValidators)
207
var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme,
Options
)
232
if (
Options
.RefreshOnIssuerKeyNotFound &&
Options
.ConfigurationManager != null
235
Options
.ConfigurationManager.RequestRefresh();
242
var tokenValidationParameters =
Options
.TokenValidationParameters.Clone();
244
if (
Options
.ConfigurationManager is BaseConfigurationManager baseConfigurationManager)
250
if (
Options
.ConfigurationManager != null)
253
var configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
278
var eventContext = new JwtBearerChallengeContext(Context, Scheme,
Options
, properties)
284
if (
Options
.IncludeErrorDetails && eventContext.AuthenticateFailure != null)
302
Response.Headers.Append(HeaderNames.WWWAuthenticate,
Options
.Challenge);
308
var builder = new StringBuilder(
Options
.Challenge);
309
if (
Options
.Challenge.IndexOf(' ') > 0)
351
var forbiddenContext = new ForbiddenContext(Context, Scheme,
Options
);
Microsoft.AspNetCore.Authentication.MicrosoftAccount (7)
MicrosoftAccountHandler.cs (7)
43
var request = new HttpRequestMessage(HttpMethod.Get,
Options
.UserInformationEndpoint);
54
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme,
Options
, Backchannel, tokens, payload.RootElement);
66
{ "client_id",
Options
.ClientId },
71
AddQueryString(queryStrings, properties, MicrosoftChallengeProperties.ScopeKey, FormatScope,
Options
.Scope);
79
if (
Options
.UsePkce)
95
var state =
Options
.StateDataFormat.Protect(properties);
98
return QueryHelpers.AddQueryString(
Options
.AuthorizationEndpoint, queryStrings!);
Microsoft.AspNetCore.Authentication.Negotiate (11)
NegotiateHandler.cs (11)
75
if (_requestProcessed ||
Options
.DeferToServer)
135
_negotiateState ??=
Options
.StateFactory.CreateInstance();
205
if (_negotiateState.Protocol == "NTLM" && !
Options
.PersistNtlmCredentials)
218
if (
Options
.PersistKerberosCredentials)
269
var errorContext = new AuthenticationFailedContext(Context, Scheme,
Options
) { Exception = ex };
338
if (
Options
.LdapSettings.EnableLdapClaimResolution)
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);
Microsoft.AspNetCore.Authentication.OAuth (16)
OAuthHandler.cs (16)
28
protected HttpClient Backchannel =>
Options
.Backchannel;
69
var properties =
Options
.StateDataFormat.Unprotect(state);
133
var codeExchangeContext = new OAuthCodeExchangeContext(properties, code.ToString(), BuildRedirectUri(
Options
.CallbackPath));
148
if (
Options
.SaveTokens)
202
{ "client_id",
Options
.ClientId },
204
{ "client_secret",
Options
.ClientSecret },
218
var requestMessage = new HttpRequestMessage(HttpMethod.Post,
Options
.TokenEndpoint);
256
var context = new OAuthCreatingTicketContext(new ClaimsPrincipal(identity), properties, Context, Scheme,
Options
, Backchannel, tokens, user.RootElement);
273
var authorizationEndpoint = BuildChallengeUrl(properties, BuildRedirectUri(
Options
.CallbackPath));
275
Context, Scheme,
Options
,
307
{ "client_id",
Options
.ClientId },
313
if (
Options
.UsePkce)
329
parameters["state"] =
Options
.StateDataFormat.Protect(properties);
331
foreach (var additionalParameter in
Options
.AdditionalAuthorizationParameters)
336
return QueryHelpers.AddQueryString(
Options
.AuthorizationEndpoint, parameters!);
353
=> FormatScope(
Options
.Scope);
Microsoft.AspNetCore.Authentication.OpenIdConnect (95)
OpenIdConnectHandler.cs (95)
40
protected HttpClient Backchannel =>
Options
.Backchannel;
91
if (
Options
.RemoteSignOutPath.HasValue &&
Options
.RemoteSignOutPath == Request.Path)
95
else if (
Options
.SignedOutCallbackPath.HasValue &&
Options
.SignedOutCallbackPath == Request.Path)
131
var remoteSignOutContext = new RemoteSignOutContext(Context, Scheme,
Options
, message);
161
var principal = (await Context.AuthenticateAsync(
Options
.SignOutScheme))?.Principal;
200
await Context.SignOutAsync(
Options
.SignOutScheme);
210
var target = ResolveTarget(
Options
.ForwardSignOut);
221
if (_configuration == null &&
Options
.ConfigurationManager != null)
223
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
228
EnableTelemetryParameters = !
Options
.DisableTelemetry,
232
PostLogoutRedirectUri = BuildRedirectUriIfRelative(
Options
.SignedOutCallbackPath)
238
properties.RedirectUri = BuildRedirectUriIfRelative(
Options
.SignedOutRedirectUri);
247
message.IdTokenHint = await Context.GetTokenAsync(
Options
.SignOutScheme, OpenIdConnectParameterNames.IdToken);
249
var redirectContext = new RedirectContext(Context, Scheme,
Options
, properties)
268
message.State =
Options
.StateDataFormat.Protect(properties);
275
if (
Options
.AuthenticationMethod == OpenIdConnectRedirectBehavior.RedirectGet)
285
else if (
Options
.AuthenticationMethod == OpenIdConnectRedirectBehavior.FormPost)
302
throw new NotImplementedException($"An unsupported authentication method has been configured: {
Options
.AuthenticationMethod}");
322
properties =
Options
.StateDataFormat.Unprotect(message.State);
325
var signOut = new RemoteSignOutContext(Context, Scheme,
Options
, message)
393
if (_configuration == null &&
Options
.ConfigurationManager != null)
395
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
400
ClientId =
Options
.ClientId,
401
EnableTelemetryParameters = !
Options
.DisableTelemetry,
403
RedirectUri = BuildRedirectUri(
Options
.CallbackPath),
404
Resource =
Options
.Resource,
405
ResponseType =
Options
.ResponseType,
406
Prompt = properties.GetParameter<string>(OpenIdConnectParameterNames.Prompt) ??
Options
.Prompt,
407
Scope = string.Join(" ", properties.GetParameter<ICollection<string>>(OpenIdConnectParameterNames.Scope) ??
Options
.Scope),
411
if (
Options
.UsePkce &&
Options
.ResponseType == OpenIdConnectResponseType.Code)
429
var maxAge = properties.GetParameter<TimeSpan?>(OpenIdConnectParameterNames.MaxAge) ??
Options
.MaxAge;
439
if (!string.Equals(
Options
.ResponseType, OpenIdConnectResponseType.Code, StringComparison.Ordinal) ||
440
!string.Equals(
Options
.ResponseMode, OpenIdConnectResponseMode.Query, StringComparison.Ordinal))
442
message.ResponseMode =
Options
.ResponseMode;
445
if (
Options
.ProtocolValidator.RequireNonce)
447
message.Nonce =
Options
.ProtocolValidator.GenerateNonce();
453
foreach (var additionalParameter in
Options
.AdditionalAuthorizationParameters)
458
var redirectContext = new RedirectContext(Context, Scheme,
Options
, properties)
480
message.State =
Options
.StateDataFormat.Protect(properties);
490
switch (
Options
.PushedAuthorizationBehavior)
522
if (
Options
.AuthenticationMethod == OpenIdConnectRedirectBehavior.RedirectGet)
533
else if (
Options
.AuthenticationMethod == OpenIdConnectRedirectBehavior.FormPost)
550
throw new NotImplementedException($"An unsupported authentication method has been configured: {
Options
.AuthenticationMethod}");
557
var context = new PushedAuthorizationContext(Context, Scheme,
Options
, parRequest, properties);
568
if (!string.IsNullOrEmpty(
Options
.ClientSecret))
570
parRequest.Parameters.Add(OpenIdConnectParameterNames.ClientSecret,
Options
.ClientSecret);
604
authorizeRequest.Parameters.Add("client_id",
Options
.ClientId);
651
if (
Options
.SkipUnrecognizedRequests)
676
if (
Options
.SkipUnrecognizedRequests)
704
if (
Options
.SkipUnrecognizedRequests)
717
if (
Options
.SkipUnrecognizedRequests)
752
if (_configuration == null &&
Options
.ConfigurationManager != null)
755
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
763
var validationParameters =
Options
.TokenValidationParameters.Clone();
770
if (!
Options
.UseSecurityTokenValidator)
799
Options
.ProtocolValidator.ValidateAuthenticationResponse(new OpenIdConnectProtocolValidationContext()
801
ClientId =
Options
.ClientId,
850
if (!
Options
.UseSecurityTokenValidator)
895
Options
.ProtocolValidator.ValidateTokenResponse(new OpenIdConnectProtocolValidationContext()
897
ClientId =
Options
.ClientId,
905
if (
Options
.SaveTokens)
910
if (
Options
.GetClaimsFromUserInfoEndpoint)
919
foreach (var action in
Options
.ClaimActions)
933
if (
Options
.RefreshOnIssuerKeyNotFound && exception is SecurityTokenSignatureKeyNotFoundException)
935
if (
Options
.ConfigurationManager != null)
938
Options
.ConfigurationManager.RequestRefresh();
957
properties =
Options
.StateDataFormat.Unprotect(message.State);
1091
Options
.ProtocolValidator.ValidateUserInfoResponse(new OpenIdConnectProtocolValidationContext()
1099
foreach (var action in
Options
.ClaimActions)
1162
var cookieOptions =
Options
.NonceCookie.Build(Context, TimeProvider.GetUtcNow());
1165
Options
.NonceCookie.Name +
Options
.StringDataFormat.Protect(nonce),
1186
if (
Options
.NonceCookie.Name is string name && nonceKey.StartsWith(name, StringComparison.Ordinal))
1190
var nonceDecodedValue =
Options
.StringDataFormat.Unprotect(nonceKey.Substring(
Options
.NonceCookie.Name.Length, nonceKey.Length -
Options
.NonceCookie.Name.Length));
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)
1264
ClientId =
Options
.ClientId,
1265
ClientSecret =
Options
.ClientSecret,
1268
EnableTelemetryParameters = !
Options
.DisableTelemetry,
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
)
1387
if (!
Options
.SecurityTokenValidator.CanReadToken(idToken))
1404
var principal =
Options
.SecurityTokenValidator.ValidateToken(idToken, validationParameters, out SecurityToken validatedToken);
1422
if (
Options
.UseTokenLifetime)
1443
if (
Options
.ConfigurationManager is BaseConfigurationManager baseConfigurationManager)
1456
var validationResult = await
Options
.TokenHandler.ValidateTokenAsync(idToken, validationParameters);
1477
if (
Options
.UseTokenLifetime)
Microsoft.AspNetCore.Authentication.Test (3)
DynamicSchemeTests.cs (2)
120
if (
Options
.Instance != null)
122
id.AddClaim(new Claim("Count",
Options
.Instance.Count.ToString(CultureInfo.InvariantCulture)));
OpenIdConnect\OpenIdConnectConfigurationTests.cs (1)
444
Assert.Equal($"{TestServerBuilder.DefaultAuthority}/.well-known/openid-configuration", handler.
Options
.MetadataAddress);
Microsoft.AspNetCore.Authentication.Twitter (16)
TwitterHandler.cs (16)
25
private HttpClient Backchannel =>
Options
.Backchannel;
61
var protectedRequestToken = Request.Cookies[
Options
.StateCookie.Name!];
63
var requestToken =
Options
.StateDataFormat.Unprotect(protectedRequestToken);
101
var cookieOptions =
Options
.StateCookie.Build(Context, TimeProvider.GetUtcNow());
103
Response.Cookies.Delete(
Options
.StateCookie.Name!, cookieOptions);
117
if (
Options
.RetrieveUserDetails)
128
if (
Options
.SaveTokens)
152
foreach (var action in
Options
.ClaimActions)
157
var context = new TwitterCreatingTicketContext(Context, Scheme,
Options
, new ClaimsPrincipal(identity), properties, token.UserId, token.ScreenName, token.Token, token.TokenSecret, user);
172
var requestToken = await ObtainRequestTokenAsync(BuildRedirectUri(
Options
.CallbackPath), properties);
175
var cookieOptions =
Options
.StateCookie.Build(Context, TimeProvider.GetUtcNow());
177
Response.Cookies.Append(
Options
.StateCookie.Name!,
Options
.StateDataFormat.Protect(requestToken), cookieOptions);
179
var redirectContext = new RedirectContext<TwitterOptions>(Context, Scheme,
Options
, properties, twitterAuthenticationEndpoint);
187
{ "oauth_consumer_key",
Options
.ConsumerKey! },
230
var signature = ComputeSignature(
Options
.ConsumerSecret!, accessToken?.TokenSecret, stringBuilder.ToString());
Microsoft.AspNetCore.Authentication.WsFederation (36)
WsFederationHandler.cs (36)
70
if (
Options
.RemoteSignOutPath.HasValue &&
Options
.RemoteSignOutPath == Request.Path && HttpMethods.IsGet(Request.Method)
89
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
101
Wtrealm =
Options
.Wtrealm,
105
if (!string.IsNullOrEmpty(
Options
.Wreply))
107
wsFederationMessage.Wreply =
Options
.Wreply;
111
wsFederationMessage.Wreply = BuildRedirectUri(
Options
.CallbackPath);
116
var redirectContext = new RedirectContext(Context, Scheme,
Options
, properties)
134
wsFederationMessage.Wctx = Uri.EscapeDataString(
Options
.StateDataFormat.Protect(properties));
170
if (
Options
.SkipUnrecognizedRequests)
185
properties =
Options
.StateDataFormat.Unprotect(state);
189
if (!
Options
.AllowUnsolicitedLogins)
201
var messageReceivedContext = new MessageReceivedContext(Context, Scheme,
Options
, properties)
233
var securityTokenReceivedContext = new SecurityTokenReceivedContext(Context, Scheme,
Options
, properties)
248
if (!
Options
.UseSecurityTokenHandlers)
250
foreach (var tokenHandler in
Options
.TokenHandlers)
281
foreach (var validator in
Options
.SecurityTokenHandlers)
317
if (
Options
.UseTokenLifetime && validatedToken != null)
333
var securityTokenValidatedContext = new SecurityTokenValidatedContext(Context, Scheme,
Options
, principal, properties)
356
var authenticationFailedContext = new AuthenticationFailedContext(Context, Scheme,
Options
)
375
var tokenValidationParameters =
Options
.TokenValidationParameters.Clone();
377
if (
Options
.ConfigurationManager is BaseConfigurationManager baseConfigurationManager)
383
if (
Options
.ConfigurationManager != null)
386
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
401
if (
Options
.RefreshOnIssuerKeyNotFound && exception is SecurityTokenSignatureKeyNotFoundException)
403
Options
.ConfigurationManager.RequestRefresh();
413
var target = ResolveTarget(
Options
.ForwardSignOut);
422
_configuration = await
Options
.ConfigurationManager.GetConfigurationAsync(Context.RequestAborted);
428
Wtrealm =
Options
.Wtrealm,
440
else if (!string.IsNullOrEmpty(
Options
.SignOutWreply))
442
wsFederationMessage.Wreply = BuildRedirectUriIfRelative(
Options
.SignOutWreply);
444
else if (!string.IsNullOrEmpty(
Options
.Wreply))
446
wsFederationMessage.Wreply = BuildRedirectUriIfRelative(
Options
.Wreply);
449
var redirectContext = new RedirectContext(Context, Scheme,
Options
, properties)
477
var remoteSignOutContext = new RemoteSignOutContext(Context, Scheme,
Options
, message);
496
await Context.SignOutAsync(
Options
.SignOutScheme);