66 references to IdentityConstants
Microsoft.AspNetCore.Identity (66)
IdentityApiEndpointRouteBuilderExtensions.cs (4)
97signInManager.AuthenticationScheme = useCookieScheme ? IdentityConstants.ApplicationScheme : IdentityConstants.BearerScheme; 126var refreshTokenProtector = bearerTokenOptions.Get(IdentityConstants.BearerScheme).RefreshTokenProtector; 139return TypedResults.SignIn(newPrincipal, authenticationScheme: 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; 143.AddAuthentication(IdentityConstants.BearerAndApplicationScheme) 144.AddScheme<AuthenticationSchemeOptions, CompositeIdentityHandler>(IdentityConstants.BearerAndApplicationScheme, null, compositeOptions => 146compositeOptions.ForwardDefault = IdentityConstants.BearerScheme; 147compositeOptions.ForwardAuthenticate = IdentityConstants.BearerAndApplicationScheme; 149.AddBearerToken(IdentityConstants.BearerScheme) 163=> services.Configure(IdentityConstants.ApplicationScheme, configure); 172=> services.Configure(IdentityConstants.ExternalScheme, configure); 196var bearerResult = await Context.AuthenticateAsync(IdentityConstants.BearerScheme); 205return await Context.AuthenticateAsync(IdentityConstants.ApplicationScheme);
SecurityStampValidator.cs (3)
160await SignInManager.Context.SignOutAsync(IdentityConstants.TwoFactorRememberMeScheme); 182/// Used to validate the <see cref="IdentityConstants.TwoFactorUserIdScheme"/> and 183/// <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; 313if (await _schemes.GetSchemeAsync(IdentityConstants.ExternalScheme) != null) 315await Context.SignOutAsync(IdentityConstants.ExternalScheme); 317if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 319await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 704var claimsIdentity = new ClaimsIdentity(IdentityConstants.TwoFactorUserIdScheme); 706await Context.SignInAsync(IdentityConstants.TwoFactorUserIdScheme, claimsPrincipal, props); 715var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme); 716await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 748if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorRememberMeScheme) == null) 754var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorRememberMeScheme); 769await Context.SignInAsync(IdentityConstants.TwoFactorRememberMeScheme, 772_metrics?.RememberTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme); 776_metrics?.RememberTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme, ex); 789await Context.SignOutAsync(IdentityConstants.TwoFactorRememberMeScheme); 790_metrics?.ForgetTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme); 794_metrics?.ForgetTwoFactorClient(typeof(TUser).FullName!, IdentityConstants.TwoFactorRememberMeScheme, ex); 860if (await _schemes.GetSchemeAsync(IdentityConstants.ExternalScheme) != null) 862await Context.SignOutAsync(IdentityConstants.ExternalScheme); 865if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 867await Context.SignOutAsync(IdentityConstants.TwoFactorUserIdScheme); 1092var auth = await Context.AuthenticateAsync(IdentityConstants.ExternalScheme); 1179var identity = new ClaimsIdentity(IdentityConstants.TwoFactorUserIdScheme); 1191var rememberBrowserIdentity = new ClaimsIdentity(IdentityConstants.TwoFactorRememberMeScheme); 1236if (await _schemes.GetSchemeAsync(IdentityConstants.TwoFactorUserIdScheme) != null) 1240await Context.SignInAsync(IdentityConstants.TwoFactorUserIdScheme, StoreTwoFactorInfo(userId, loginProvider)); 1249await Context.SignOutAsync(IdentityConstants.ExternalScheme); 1269var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme);