Created
December 6, 2017 14:43
-
-
Save HamidMosalla/3274c340634dd9d0bad1772be8b93cca to your computer and use it in GitHub Desktop.
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddDbContext<ApplicationDbContext>(options => | |
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); | |
services.AddIdentity<ApplicationUser, IdentityRole>() | |
.AddEntityFrameworkStores<ApplicationDbContext>() | |
.AddDefaultTokenProviders(); | |
// Add application services. | |
services.AddTransient<IEmailSender, EmailSender>(); | |
services.AddMvc(); | |
// configure identity server with in-memory stores, keys, clients and scopes | |
services.AddIdentityServer() | |
.AddDeveloperSigningCredential() | |
.AddInMemoryPersistedGrants() | |
.AddInMemoryIdentityResources(Config.GetIdentityResources()) | |
.AddInMemoryApiResources(Config.GetApiResources()) | |
.AddInMemoryClients(Config.GetClients()) | |
.AddAspNetIdentity<ApplicationUser>() | |
.AddProfileService<ProfileService>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment