using AuthServer.Host.EntityFrameworkCore; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Volo.Abp.Account.Web; using Volo.Abp.AspNetCore.Modularity; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; using Volo.Abp.Identity; using Volo.Abp.Identity.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.Threading; namespace AuthServer.Host { [DependsOn( typeof(AbpAutofacModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpAuditLoggingEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpIdentityEntityFrameworkCoreModule), typeof(AbpIdentityApplicationContractsModule), typeof(AbpIdentityServerEntityFrameworkCoreModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpAccountWebModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule) )] public class AuthServerHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAbpDbContext(options => { options.AddDefaultRepositories(); }); Configure(options => { options.UseSqlServer(); }); Configure(options => { options.Languages.Add(new LanguageInfo("en", "en", "English")); }); } public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseVirtualFiles(); app.UseIdentityServer(); app.UseAbpRequestLocalization(); app.UseAuditing(); app.UseMvcWithDefaultRouteAndArea(); //TODO: Problem on a clustered environment AsyncHelper.RunSync(async () => { await context.ServiceProvider .GetRequiredService() .SeedAsync( "1q2w3E*", IdentityPermissions.GetAll() ); }); } } }