diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/AbpAspNetCoreAuthenticationJwtBearerModule.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/AbpAspNetCoreAuthenticationJwtBearerModule.cs index 3d6bf5e5be..89d957fe57 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/AbpAspNetCoreAuthenticationJwtBearerModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/AbpAspNetCoreAuthenticationJwtBearerModule.cs @@ -14,8 +14,9 @@ public class AbpAspNetCoreAuthenticationJwtBearerModule : AbpModule { context.Services.AddHttpClient(); context.Services.AddHttpContextAccessor(); - var abpClaimsPrincipalFactoryOptions = context.Services.ExecutePreConfiguredActions(); - if (abpClaimsPrincipalFactoryOptions.IsRemoteRefreshEnabled) + + if (context.Services.ExecutePreConfiguredActions().IsEnabled && + context.Services.ExecutePreConfiguredActions().IsRemoteRefreshEnabled) { context.Services.AddTransient(); context.Services.AddTransient(); diff --git a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/DynamicClaims/WebRemoteDynamicClaimsPrincipalContributorOptions.cs b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/DynamicClaims/WebRemoteDynamicClaimsPrincipalContributorOptions.cs index 960ebbb38c..1d51a29661 100644 --- a/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/DynamicClaims/WebRemoteDynamicClaimsPrincipalContributorOptions.cs +++ b/framework/src/Volo.Abp.AspNetCore.Authentication.JwtBearer/Volo/Abp/AspNetCore/Authentication/JwtBearer/DynamicClaims/WebRemoteDynamicClaimsPrincipalContributorOptions.cs @@ -4,10 +4,13 @@ namespace Volo.Abp.AspNetCore.Authentication.JwtBearer.DynamicClaims; public class WebRemoteDynamicClaimsPrincipalContributorOptions { + public bool IsEnabled { get; set; } + public string AuthenticationScheme { get; set; } public WebRemoteDynamicClaimsPrincipalContributorOptions() { + IsEnabled = false; AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme; } }