@@ -18,11 +18,11 @@ namespace Duende.IdentityServer.Validation;
1818/// Default validator for pushed authorization requests. This validator performs
1919/// checks that are specific to pushed authorization and also invokes the <see
2020/// cref="IAuthorizeRequestValidator"/> to validate the pushed parameters as if
21- /// they had been sent to the authorize endpoint directly.
21+ /// they had been sent to the authorize endpoint directly.
2222/// </summary>
2323/// <remarks>
2424/// Initializes a new instance of the <see
25- /// cref="PushedAuthorizationRequestValidator"/> class.
25+ /// cref="PushedAuthorizationRequestValidator"/> class.
2626/// </remarks>
2727/// <param name="authorizeRequestValidator">The authorize request validator,
2828/// used to validate the pushed authorization parameters as if they were
@@ -33,13 +33,15 @@ namespace Duende.IdentityServer.Validation;
3333/// <param name="serverUrls">The server urls service</param>
3434/// <param name="licenseUsage">The feature manager</param>
3535/// <param name="options">The IdentityServer Options</param>
36+ /// <param name="mtlsEndpointGenerator">The mTLS endpoint generator</param>
3637/// <param name="logger">The logger</param>
3738internal class PushedAuthorizationRequestValidator (
3839 IAuthorizeRequestValidator authorizeRequestValidator ,
3940 IDPoPProofValidator dpopProofValidator ,
4041 IServerUrls serverUrls ,
4142 LicenseUsageTracker licenseUsage ,
4243 IdentityServerOptions options ,
44+ IMtlsEndpointGenerator mtlsEndpointGenerator ,
4345 ILogger < PushedAuthorizationRequestValidator > logger ) : IPushedAuthorizationRequestValidator
4446{
4547 public async Task < PushedAuthorizationValidationResult > ValidateAsync ( PushedAuthorizationRequestValidationContext context )
@@ -57,17 +59,17 @@ public async Task<PushedAuthorizationValidationResult> ValidateAsync(PushedAutho
5759
5860 // -- DPoP Header Validation --
5961 // The client can send the public key of its DPoP proof key to us. We
60- // then bind its authorization code to the proof key and check for a
62+ // then bind its authorization code to the proof key and check for a
6163 // proof token signed with the key at the token endpoint.
62- //
63- // There are two ways for the client to send its DPoP proof key public
64+ //
65+ // There are two ways for the client to send its DPoP proof key public
6466 // key material to us:
6567 // 1. pass the dpop_jkt parameter with a JWK thumbprint (RFC 7638)
66- // 2. send a DPoP proof (which contains the public key as a JWK) in the
68+ // 2. send a DPoP proof (which contains the public key as a JWK) in the
6769 // DPoP http header
6870 //
69- // If a proof is passed, then we validate it, compute the thumbprint of
70- // the key within, and treat that as if it were passed as the dpop_jkt
71+ // If a proof is passed, then we validate it, compute the thumbprint of
72+ // the key within, and treat that as if it were passed as the dpop_jkt
7173 // parameter.
7274 //
7375 // If a proof and a dpop_jkt are both passed, its an error if they don't
@@ -84,7 +86,7 @@ public async Task<PushedAuthorizationValidationResult> ValidateAsync(PushedAutho
8486 }
8587
8688 // validate proof token
87- var parUrl = serverUrls . BaseUrl . EnsureTrailingSlash ( ) + ProtocolRoutePaths . PushedAuthorization ;
89+ var parUrl = context . ClientCertificate == null ? serverUrls . BaseUrl . EnsureTrailingSlash ( ) + ProtocolRoutePaths . PushedAuthorization : mtlsEndpointGenerator . GetMtlsEndpointPath ( ProtocolRoutePaths . PushedAuthorization ) ;
8890 var dpopContext = new DPoPProofValidatonContext
8991 {
9092 ProofToken = context . DPoPProofToken ,
0 commit comments