Browse Source
Merge pull request #18197 from abpframework/WebRemoteDynamicClaimsPrincipalContributorOptions
Add `IsEnabled ` to `WebRemoteDynamicClaimsPrincipalContributorOptions`.
pull/18200/head
liangshiwei
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
2 deletions
-
framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/AbpAspNetCoreAuthenticationJwtBearerModule.cs
-
framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/DynamicClaims/WebRemoteDynamicClaimsPrincipalContributorOptions.cs
|
|
@ -14,8 +14,9 @@ public class AbpAspNetCoreAuthenticationJwtBearerModule : AbpModule |
|
|
{ |
|
|
{ |
|
|
context.Services.AddHttpClient(); |
|
|
context.Services.AddHttpClient(); |
|
|
context.Services.AddHttpContextAccessor(); |
|
|
context.Services.AddHttpContextAccessor(); |
|
|
var abpClaimsPrincipalFactoryOptions = context.Services.ExecutePreConfiguredActions<AbpClaimsPrincipalFactoryOptions>(); |
|
|
|
|
|
if (abpClaimsPrincipalFactoryOptions.IsRemoteRefreshEnabled) |
|
|
if (context.Services.ExecutePreConfiguredActions<WebRemoteDynamicClaimsPrincipalContributorOptions>().IsEnabled && |
|
|
|
|
|
context.Services.ExecutePreConfiguredActions<AbpClaimsPrincipalFactoryOptions>().IsRemoteRefreshEnabled) |
|
|
{ |
|
|
{ |
|
|
context.Services.AddTransient<WebRemoteDynamicClaimsPrincipalContributor>(); |
|
|
context.Services.AddTransient<WebRemoteDynamicClaimsPrincipalContributor>(); |
|
|
context.Services.AddTransient<WebRemoteDynamicClaimsPrincipalContributorCache>(); |
|
|
context.Services.AddTransient<WebRemoteDynamicClaimsPrincipalContributorCache>(); |
|
|
|
|
|
@ -4,10 +4,13 @@ namespace Volo.Abp.AspNetCore.Authentication.JwtBearer.DynamicClaims; |
|
|
|
|
|
|
|
|
public class WebRemoteDynamicClaimsPrincipalContributorOptions |
|
|
public class WebRemoteDynamicClaimsPrincipalContributorOptions |
|
|
{ |
|
|
{ |
|
|
|
|
|
public bool IsEnabled { get; set; } |
|
|
|
|
|
|
|
|
public string AuthenticationScheme { get; set; } |
|
|
public string AuthenticationScheme { get; set; } |
|
|
|
|
|
|
|
|
public WebRemoteDynamicClaimsPrincipalContributorOptions() |
|
|
public WebRemoteDynamicClaimsPrincipalContributorOptions() |
|
|
{ |
|
|
{ |
|
|
|
|
|
IsEnabled = false; |
|
|
AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme; |
|
|
AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|