77 references to IdentityConstants
Microsoft.AspNetCore.Identity (68)
IdentityApiEndpointRouteBuilderExtensions.cs (5)
43/// The passkey endpoints use the <see cref="IdentityConstants.TwoFactorUserIdScheme"/> cookie to store state between 180var refreshTokenProtector = bearerTokenOptions.Get(IdentityConstants.BearerScheme).RefreshTokenProtector; 193return TypedResults.SignIn(newPrincipal, authenticationScheme: IdentityConstants.BearerScheme); 659signInManager.AuthenticationScheme = useCookieScheme ? IdentityConstants.ApplicationScheme : IdentityConstants.BearerScheme;
IdentityCookiesBuilderExtensions.cs (11)
49builder.AddCookie(IdentityConstants.ApplicationScheme, o => 57return new OptionsBuilder<CookieAuthenticationOptions>(builder.Services, IdentityConstants.ApplicationScheme); 67builder.AddCookie(IdentityConstants.ExternalScheme, o => 69o.Cookie.Name = IdentityConstants.ExternalScheme; 72return new OptionsBuilder<CookieAuthenticationOptions>(builder.Services, IdentityConstants.ExternalScheme); 82builder.AddCookie(IdentityConstants.TwoFactorRememberMeScheme, o => 84o.Cookie.Name = IdentityConstants.TwoFactorRememberMeScheme; 90return new OptionsBuilder<CookieAuthenticationOptions>(builder.Services, IdentityConstants.TwoFactorRememberMeScheme); 100builder.AddCookie(IdentityConstants.TwoFactorUserIdScheme, o => 102o.Cookie.Name = IdentityConstants.TwoFactorUserIdScheme; 109return new OptionsBuilder<CookieAuthenticationOptions>(builder.Services, IdentityConstants.TwoFactorUserIdScheme);
IdentityServiceCollectionExtensions.cs (19)
55options.DefaultAuthenticateScheme = IdentityConstants.ApplicationScheme; 56options.DefaultChallengeScheme = IdentityConstants.ApplicationScheme; 57options.DefaultSignInScheme = IdentityConstants.ExternalScheme; 59.AddCookie(IdentityConstants.ApplicationScheme, o => 67.AddCookie(IdentityConstants.ExternalScheme, o => 69o.Cookie.Name = IdentityConstants.ExternalScheme; 72.AddCookie(IdentityConstants.TwoFactorRememberMeScheme, o => 74o.Cookie.Name = IdentityConstants.TwoFactorRememberMeScheme; 80.AddCookie(IdentityConstants.TwoFactorUserIdScheme, o => 82o.Cookie.Name = IdentityConstants.TwoFactorUserIdScheme; 144.AddAuthentication(IdentityConstants.BearerAndApplicationScheme) 145.AddScheme<AuthenticationSchemeOptions, CompositeIdentityHandler>(IdentityConstants.BearerAndApplicationScheme, null, compositeOptions => 147compositeOptions.ForwardDefault = IdentityConstants.BearerScheme; 148compositeOptions.ForwardAuthenticate = IdentityConstants.BearerAndApplicationScheme; 150.AddBearerToken(IdentityConstants.BearerScheme) 164=> services.Configure(IdentityConstants.ApplicationScheme, configure); 173=> services.Configure(IdentityConstants.ExternalScheme, configure); 212var bearerResult = await Context.AuthenticateAsync(IdentityConstants.BearerScheme); 221return await Context.AuthenticateAsync(IdentityConstants.ApplicationScheme);
SecurityStampValidator.cs (4)
162if (await schemes.GetSchemeAsync(IdentityConstants.TwoFactorRememberMeScheme) != null) 164await SignInManager.Context.SignOutAsync(IdentityConstants.TwoFactorRememberMeScheme); 187/// Used to validate the <see cref="IdentityConstants.TwoFactorUserIdScheme"/> and 188/// <see cref="IdentityConstants.TwoFactorRememberMeScheme"/> cookies against the user's
SignInManager.cs (29)
99/// The authentication scheme to sign in with. Defaults to <see cref="IdentityConstants.ApplicationScheme"/>. 101public string AuthenticationScheme { get; set; } = IdentityConstants.ApplicationScheme; 322if (await _schemes.GetSchemeAsync(IdentityConstants.ExternalScheme) != null) 324await Context.SignOutAsync(IdentityConstants.ExternalScheme); 326if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 328await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 929var claimsIdentity = new ClaimsIdentity(IdentityConstants.TwoFactorUserIdScheme); 931await Context.SignInAsync(IdentityConstants.TwoFactorUserIdScheme, claimsPrincipal, props); 940var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme); 941await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 973if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorRememberMeScheme) == null) 979var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorRememberMeScheme); 994await Context.SignInAsync(IdentityConstants.TwoFactorRememberMeScheme, 997_metrics?.RememberTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme); 1001_metrics?.RememberTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme, ex); 1014await Context.SignOutAsync(IdentityConstants.TwoFactorRememberMeScheme); 1015_metrics?.ForgetTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme); 1019_metrics?.ForgetTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme, ex); 1085if (await _schemes.GetSchemeAsync(IdentityConstants.ExternalScheme) != null) 1087await Context.SignOutAsync(IdentityConstants.ExternalScheme); 1090if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 1092await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 1317var auth = await Context.AuthenticateAsync(IdentityConstants.ExternalScheme); 1405var identity = new ClaimsIdentity(IdentityConstants.TwoFactorUserIdScheme); 1422var rememberBrowserIdentity = new ClaimsIdentity(IdentityConstants.TwoFactorRememberMeScheme); 1467if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 1470await Context.SignInAsync(IdentityConstants.TwoFactorUserIdScheme, await StoreTwoFactorInfo(user, loginProvider)); 1479await Context.SignOutAsync(IdentityConstants.ExternalScheme); 1499var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme);
Microsoft.AspNetCore.Identity.UI (9)
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (1)
113await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
Areas\Identity\Pages\V4\Account\Manage\ExternalLogins.cshtml.cs (2)
130await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); 161await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (1)
113await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
Areas\Identity\Pages\V5\Account\Manage\ExternalLogins.cshtml.cs (2)
130await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme); 161await HttpContext.SignOutAsync(IdentityConstants.ExternalScheme);
IdentityDefaultUIConfigureOptions.cs (1)
53if (string.Equals(IdentityConstants.ApplicationScheme, name, StringComparison.Ordinal))
IdentityServiceCollectionUIExtensions.cs (2)
43o.DefaultScheme = IdentityConstants.ApplicationScheme; 44o.DefaultSignInScheme = IdentityConstants.ExternalScheme;