diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderOptions.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderOptions.cs
index 1b7eb8f4d3..be76a5c008 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderOptions.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerBuilderOptions.cs
@@ -22,5 +22,10 @@ namespace Volo.Abp.IdentityServer
/// Default: true.
///
public bool IntegrateToAspNetIdentity { get; set; } = true;
+
+ ///
+ /// Set false to suppress AddDeveloperSigningCredential() call on the IIdentityServerBuilder.
+ ///
+ public bool AddDeveloperSigningCredential { get; set; } = true;
}
}
\ No newline at end of file
diff --git a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
index 7bb3ab1750..c89e7e74d2 100644
--- a/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
+++ b/modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/AbpIdentityServerDomainModule.cs
@@ -1,4 +1,5 @@
-using IdentityServer4.Services;
+using System.Security.Cryptography.X509Certificates;
+using IdentityServer4.Services;
using IdentityServer4.Stores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
@@ -24,6 +25,7 @@ namespace Volo.Abp.IdentityServer
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper();
+
Configure(options =>
{
options.AddProfile(validate: true);
@@ -45,9 +47,12 @@ namespace Volo.Abp.IdentityServer
options.Events.RaiseSuccessEvents = true;
});
- identityServerBuilder
- .AddDeveloperSigningCredential() //TODO: Should be able to change this!
- .AddAbpIdentityServer(builderOptions);
+ if (builderOptions.AddDeveloperSigningCredential)
+ {
+ identityServerBuilder = identityServerBuilder.AddDeveloperSigningCredential();
+ }
+
+ identityServerBuilder.AddAbpIdentityServer(builderOptions);
services.ExecutePreConfiguredActions(identityServerBuilder);