Skip to content

Commit 7893932

Browse files
committed
Failing test for TokenEndpointAuthenticationSigningAlgorithmsSupported
1 parent 801fd0b commit 7893932

File tree

3 files changed

+25
-2
lines changed

3 files changed

+25
-2
lines changed

identity-model/src/IdentityModel/Client/Messages/DiscoveryDocumentResponse.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,13 @@ protected override Task InitializeAsync(object? initializationData = null)
254254
/// </value>
255255
public IEnumerable<string> TokenEndpointAuthenticationMethodsSupported => TryGetStringArray(OidcConstants.Discovery.TokenEndpointAuthenticationMethodsSupported);
256256

257+
/// <summary>
258+
/// Gets the signing algorithms supported by the token endpoint for the signature on the JWT used to authenticate
259+
/// the client at the token endpoint for the "private_key_jwt" and "client_secret_jwt" authentication methods.
260+
/// </summary>
261+
public IEnumerable<string> TokenEndpointAuthenticationSigningAlgorithmsSupported => [];
262+
263+
257264
/// <summary>
258265
/// Gets the supported backchannel token delivery modes.
259266
/// </summary>

identity-model/test/IdentityModel.Tests/HttpClientExtensions/DiscoveryExtensionsTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,18 @@ public async Task Strongly_typed_accessors_should_behave_as_expected()
306306
claims.ShouldContain("phone_number");
307307
claims.ShouldContain("phone_number_verified");
308308

309+
// Token Authentication Methods
310+
var tokenEndpointAuthMethods = disco.TokenEndpointAuthenticationMethodsSupported.ToList();
311+
tokenEndpointAuthMethods.Count.ShouldBe(3);
312+
tokenEndpointAuthMethods.ShouldContain("client_secret_post");
313+
tokenEndpointAuthMethods.ShouldContain("client_secret_basic");
314+
tokenEndpointAuthMethods.ShouldContain("private_key_jwt");
315+
316+
// Token Authentication Signing Algorithms for private_key_jwt
317+
var tokenEndpointAuthSigningAlgorithms = disco.TokenEndpointAuthenticationSigningAlgorithmsSupported.ToList();
318+
tokenEndpointAuthSigningAlgorithms.Count.ShouldBe(1);
319+
tokenEndpointAuthSigningAlgorithms.ShouldContain("RS256");
320+
309321
// JWKS data
310322
disco.KeySet.Keys.Count.ShouldBe(1);
311323
disco.KeySet.Keys.First().Kid.ShouldBe("a3rMUgMFv9tPclLa6yF3zAkfquE");

identity-model/test/IdentityModel.Tests/documents/discovery.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@
7979
],
8080
"token_endpoint_auth_methods_supported": [
8181
"client_secret_post",
82-
"client_secret_basic"
82+
"client_secret_basic",
83+
"private_key_jwt"
84+
],
85+
"token_endpoint_auth_signing_alg_values_supported": [
86+
"RS256"
8387
],
8488
"require_pushed_authorization_requests": true
85-
}
89+
}

0 commit comments

Comments
 (0)