Last active
October 12, 2020 17:04
-
-
Save ghstahl/2a3ba13ce8197cb638626fb632e2237d to your computer and use it in GitHub Desktop.
Keeping Authentication and Session in sync in asp.net core 3.x - Startup.cs identity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddIdentity<IdentityUser,IdentityRole>(options => options.SignIn.RequireConfirmedAccount = true) | |
.AddEntityFrameworkStores<ApplicationDbContext>() | |
.AddDefaultTokenProviders(); | |
// services.AddDefaultIdentity must be adding its own fake | |
// Switched to services.AddIdentity<IdentityUser,IdentityRole>, and now I have to add it. | |
services.AddScoped<IEmailSender, FakeEmailSender>(); | |
services.AddScoped<IUserClaimsPrincipalFactory<IdentityUser>, SeedSessionClaimsPrincipalFactory>(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment