public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AuthDbContext>(options => options.UseSqlServer(_configuration.GetConnectionString("AuthConnection"))); services.AddIdentity <ApplicationUser, IdentityRole>(options => options.User.RequireUniqueEmail = true) .AddEntityFrameworkStores <AuthDbContext>() .AddDefaultTokenProviders(); services.AddIdentityServer() .AddDeveloperSigningCredential() .AddInMemoryPersistedGrants() .AddInMemoryIdentityResources(IdentityServerConfig.GetIdentityResources()) .AddInMemoryApiResources(IdentityServerConfig.GetApiResources()) .AddInMemoryClients(IdentityServerConfig.GetClients()) .AddAspNetIdentity <ApplicationUser>(); services.AddControllersWithViews(); }