Skip to content

Support binding of authorization codes to dpop proof key via dpop header#1974

Merged
josephdecock merged 9 commits intomainfrom
jmdc/dpop-and-par-jkt
Apr 25, 2025
Merged

Support binding of authorization codes to dpop proof key via dpop header#1974
josephdecock merged 9 commits intomainfrom
jmdc/dpop-and-par-jkt

Conversation

@josephdecock
Copy link
Member

@josephdecock josephdecock commented Apr 24, 2025

This PR adds support for the DPoP header at the PAR endpoint.

The DPoP header at the PAR endpoint is used to bind authorization codes to the client's dpop key. This can also be done by (and we already support) passing the dpop_jkt parameter.

This change improves our support for RFC 9449, as accepting the DPoP header is a requirement for compliance now that we implement PAR (section 10.1). We also now enforce the rule that if both the header and the dpop_jkt parameter are passed, they must be consistent.

This PR also significantly refactors the existing DPOP integration tests to make them easier to read and reuse. Most behaviors are the same whether authorize parameters are pushed or not, and either or both of the dpop binding mechanisms can be used with PAR, so we want to run through most of those tests in several ways.

This PR updates our error responses to consistently return "use_dpop_nonce" as the error when a request fails and needs a new nonce, even if an invalid or expired nonce was passed.

@josephdecock josephdecock self-assigned this Apr 24, 2025
@josephdecock josephdecock added the area/products/is IdentityServer label Apr 24, 2025
@josephdecock josephdecock marked this pull request as ready for review April 24, 2025 18:43
@josephdecock josephdecock requested a review from bhazen as a code owner April 24, 2025 18:43
- Add `DPoPProofToken` to validation context
- Populate with value of DPoP http header in requests to PAR endpoint
- Return invalid_request error if multiple DPoP headers passed to PAR
Many of the existing tests make an authorize request and then exchange the code for a token. We have similar use cases, and some additional validation, when using PAR. Refactoring the existing tests will facilitate reuse in the PAR case.
Done
- Header is parsed, validated, and authorization code will be bound to the proof's key
- Content length restrictions enforced
- Duplicate headers disallowed
- Mismatch between jwk in header value and jkt in parameter if both are passed disallowed

To Do
- Support for use_dpop_nonce response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/products/is IdentityServer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants