Browse Source

Merge pull request #4443 from abpframework/liangshiwei/module-identity-patch-1

Use PreConfigure to configure IdentityBuilder
pull/4516/head
Halil İbrahim Kalkan 6 years ago
committed by GitHub
parent
commit
099f898d98
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpIdentityAspNetCoreModule.cs

14
modules/identity/src/Volo.Abp.Identity.AspNetCore/Volo/Abp/Identity/AspNetCore/AbpIdentityAspNetCoreModule.cs

@ -9,13 +9,17 @@ namespace Volo.Abp.Identity.AspNetCore
)]
public class AbpIdentityAspNetCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services
.GetObject<IdentityBuilder>()
.AddDefaultTokenProviders()
.AddSignInManager();
PreConfigure<IdentityBuilder>(builder =>
{
builder.AddDefaultTokenProviders();
builder.AddSignInManager();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
//(TODO: Extract an extension method like IdentityBuilder.AddAbpSecurityStampValidator())
context.Services.AddScoped<AbpSecurityStampValidator>();
context.Services.AddScoped(typeof(SecurityStampValidator<IdentityUser>), provider => provider.GetService(typeof(AbpSecurityStampValidator)));

Loading…
Cancel
Save