Last active
November 17, 2020 20:43
-
-
Save vaygeth89/994615e41900e8d8bf6c5b98365675ba to your computer and use it in GitHub Desktop.
tutorial-dotnet-JWTProtectedAPI ConfigureServices()
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
//rest of Startup.cs code | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
services.AddDbContext<AppDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SqlServerDb"))); | |
services.AddIdentity<IdentityUser, IdentityRole>(options => | |
{ | |
//! Change your security Policy here to suits your policy | |
options.Password.RequireUppercase = false; | |
options.Password.RequireDigit = false; | |
//! tutorial purposes im allowed users to sign in without their email confirmation | |
options.SignIn.RequireConfirmedEmail = false; | |
}).AddEntityFrameworkStores<AppDbContext>().AddDefaultTokenProviders(); | |
setUpBearerJwtAuth(services); | |
} | |
//rest of Startup.cs code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment