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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
5 deletions
-
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))); |
|
|
|
|