diff --git a/identity-server/src/IdentityServer/Licensing/V2/License.cs b/identity-server/src/IdentityServer/Licensing/V2/License.cs
index 89774a4ea..cdec469e2 100644
--- a/identity-server/src/IdentityServer/Licensing/V2/License.cs
+++ b/identity-server/src/IdentityServer/Licensing/V2/License.cs
@@ -97,7 +97,7 @@ internal class License
if (!claims.HasClaim("feature", "unlimited_issuers"))
{
- // default
+ // default
IssuerLimit = 1;
if (int.TryParse(claims.FindFirst("issuer_limit")?.Value, out var issuerLimit))
@@ -137,7 +137,7 @@ internal class License
public DateTimeOffset? Expiration { get; init; }
///
- /// The license edition
+ /// The license edition
///
public LicenseEdition? Edition { get; init; }
@@ -220,7 +220,7 @@ internal class License
}
}
}
- throw new ArgumentException("Unknown license feature {feature}", claimValue);
+ return LicenseFeature.Unknown;
}
diff --git a/identity-server/src/IdentityServer/Licensing/V2/LicenseFeature.cs b/identity-server/src/IdentityServer/Licensing/V2/LicenseFeature.cs
index 7ae2388df..e738232dd 100644
--- a/identity-server/src/IdentityServer/Licensing/V2/LicenseFeature.cs
+++ b/identity-server/src/IdentityServer/Licensing/V2/LicenseFeature.cs
@@ -11,6 +11,11 @@ namespace Duende.IdentityServer.Licensing.V2;
///
internal enum LicenseFeature : ulong
{
+ ///
+ /// Used as a default case for missing or unknown features
+ ///
+ Unknown = 0,
+
///
/// Automatic Key Management
///
diff --git a/identity-server/test/IdentityServer.UnitTests/Licensing/v2/LicenseAccessorTests.cs b/identity-server/test/IdentityServer.UnitTests/Licensing/v2/LicenseAccessorTests.cs
index 187761e16..d5ab00c1f 100644
--- a/identity-server/test/IdentityServer.UnitTests/Licensing/v2/LicenseAccessorTests.cs
+++ b/identity-server/test/IdentityServer.UnitTests/Licensing/v2/LicenseAccessorTests.cs
@@ -22,7 +22,7 @@ public class LicenseAccessorTests
[Theory]
[MemberData(nameof(LicenseTestCases))]
- internal void license_set_in_options_is_parsed_correctly(int serialNumber, LicenseEdition edition, bool isRedistribution, string contact, bool addDynamicProviders, bool addKeyManagement, int? allowedClients, int? allowedIssuers, string key)
+ internal void license_set_in_options_is_parsed_correctly(int serialNumber, DateTime expiration, LicenseEdition edition, bool isRedistribution, string contact, string company, bool addDynamicProviders, bool addKeyManagement, int? allowedClients, int? allowedIssuers, string key)
{
_options.LicenseKey = key;
@@ -31,10 +31,10 @@ public class LicenseAccessorTests
l.IsConfigured.ShouldBeTrue();
l.Edition.ShouldBe(edition);
l.Extras.ShouldBeEmpty();
- l.CompanyName.ShouldBe("_test");
+ l.CompanyName.ShouldBe(company);
l.ContactInfo.ShouldBe(contact);
l.SerialNumber.ShouldBe(serialNumber);
- l.Expiration!.Value.Date.ShouldBe(new DateTime(2024, 11, 15));
+ l.Expiration!.Value.Date.ShouldBe(expiration);
l.Redistribution.ShouldBe(isRedistribution);
l.ClientLimit.ShouldBe(allowedClients);
l.IssuerLimit.ShouldBe(allowedIssuers);
@@ -84,23 +84,24 @@ public class LicenseAccessorTests
public static IEnumerable