Last active
December 11, 2018 08:40
-
-
Save ngohungphuc/aa1ebb290a4e84bdb7a33ebff3b6d2a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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) | |
{ | |
const string connectionString = @"Data Source=IdentityServer.db;"; | |
var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | |
services.AddDbContext<ApplicationDbContext>(builder => | |
builder.UseSqlite(connectionString, sqlOptions => sqlOptions.MigrationsAssembly(migrationsAssembly))); | |
services.AddIdentity<IdentityUser, IdentityRole>() | |
.AddEntityFrameworkStores<ApplicationDbContext>(); | |
services.AddIdentityServer() | |
//Configures EF implementation of IPersistedGrantStore with IdentityServer. | |
.AddOperationalStore(options => | |
options.ConfigureDbContext = builder => | |
builder.UseSqlite(connectionString, sqlOptions => sqlOptions.MigrationsAssembly(migrationsAssembly))) | |
//Configures EF implementation of IPersistedGrantStore with IdentityServer. | |
.AddConfigurationStore(options => | |
options.ConfigureDbContext = builder => | |
builder.UseSqlite(connectionString, sqlOptions => sqlOptions.MigrationsAssembly(migrationsAssembly))) | |
.AddAspNetIdentity<IdentityUser>() | |
.AddDeveloperSigningCredential(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment