using IdentityServer4.Configuration; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.IdentityServer; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; namespace Volo.Abp.Account.Web { [DependsOn( typeof(AbpAccountWebModule), typeof(AbpIdentityServerDomainModule) )] public class AbpAccountWebIdentityServerModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { context.Services.PreConfigure(options => { options.ConfigureAuthentication = false; }); PreConfigure(mvcBuilder => { mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAccountWebIdentityServerModule).Assembly); }); } public override void ConfigureServices(ServiceConfigurationContext context) { Configure(options => { options.FileSets.AddEmbedded(); }); Configure(options => { options.UserInteraction.ConsentUrl = "/Consent"; options.UserInteraction.ErrorUrl = "/Account/Error"; }); //TODO: Try to reuse from AbpIdentityAspNetCoreModule context.Services .AddAuthentication(o => { o.DefaultScheme = IdentityConstants.ApplicationScheme; o.DefaultSignInScheme = IdentityConstants.ExternalScheme; }) .AddIdentityCookies(); } } }