Configuring the Identity service

Enough with the theory, let's put the plan into action. Open the Startup.cs file and add the following highlighted lines:

[...]// This method gets called by the runtime. Use this method to add services to the container.public void ConfigureServices(IServiceCollection services){    services.AddMvc();    // Add EntityFramework support for SqlServer.    services.AddEntityFrameworkSqlServer();    // Add ApplicationDbContext.    services.AddDbContext<ApplicationDbContext>(options =>        options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"])        );    // Add ASP.NET Identity support    services.AddIdentity<ApplicationUser, IdentityRole>(        opts =>        {            opts.Password.RequireDigit = true; opts.Password.RequireLowercase = true; ...

Get ASP.NET Core 2 and Angular 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.