diff --git a/src/OpenIddict.Abstractions/OpenIddictResources.resx b/src/OpenIddict.Abstractions/OpenIddictResources.resx index 4ea9d0ae..77eac58a 100644 --- a/src/OpenIddict.Abstractions/OpenIddictResources.resx +++ b/src/OpenIddict.Abstractions/OpenIddictResources.resx @@ -1569,6 +1569,9 @@ To apply post-logout redirection responses, create a class implementing 'IOpenId The '{0}' client assertion type must be configured when enabling the '{1}' client authentication method. + + At least one subject type must be supported. + The security token is missing. diff --git a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs index 639ca36e..524e5356 100644 --- a/src/OpenIddict.Server/OpenIddictServerConfiguration.cs +++ b/src/OpenIddict.Server/OpenIddictServerConfiguration.cs @@ -151,6 +151,12 @@ public sealed class OpenIddictServerConfiguration : IPostConfigureOptions ResponseModes { get; } = new(StringComparer.Ordinal); + /// + /// Gets the OpenID Connect subject types enabled for this application. + /// + [EditorBrowsable(EditorBrowsableState.Advanced)] + public HashSet SubjectTypes { get; } = new(StringComparer.Ordinal) + { + OpenIddictConstants.SubjectTypes.Public + }; + /// /// Gets or sets a boolean indicating whether endpoint permissions should be ignored. /// Setting this property to is NOT recommended. diff --git a/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs b/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs index 57774301..3b9c2cf5 100644 --- a/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs +++ b/test/OpenIddict.Server.IntegrationTests/OpenIddictServerIntegrationTests.Discovery.cs @@ -794,7 +794,12 @@ public abstract partial class OpenIddictServerIntegrationTests public async Task HandleConfigurationRequest_SupportedSubjectTypesAreCorrectlyReturned() { // Arrange - await using var server = await CreateServerAsync(); + await using var server = await CreateServerAsync(options => + { + options.Configure(options => options.SubjectTypes.Remove(SubjectTypes.Public)); + options.Configure(options => options.SubjectTypes.Add("custom")); + }); + await using var client = await server.CreateClientAsync(); // Act @@ -803,7 +808,7 @@ public abstract partial class OpenIddictServerIntegrationTests // Assert Assert.NotNull(types); - Assert.Contains(SubjectTypes.Public, types); + Assert.Equal("custom", Assert.Single(types)); } [Theory]