wip: jwt and oauth2_introspection authenticators updated to support DPoP#3231
wip: jwt and oauth2_introspection authenticators updated to support DPoP#3231dadrus wants to merge 11 commits into
jwt and oauth2_introspection authenticators updated to support DPoP#3231Conversation
…/traits instead of a single error context
❌ 29 Tests Failed:
View the full list of 29 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
jwt and oauth2_introspection authenticators updated to support DPoPjwt and oauth2_introspection authenticators updated to support DPoP
|
Since there is a need for a master secret and the current secret management implementation is kind of cumbersome, I decided to refactor that first, which resulted in #3238. As soon as that is done, the work on this PR will continue |
| return s | ||
| } | ||
|
|
||
| func (s *demonstratingPoPStrategy) Assert( |
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
calculated cyclomatic complexity for function Assert is 15, max is 11 (cyclop)
|
|
||
| func (b binder) Binding() [32]byte { return b } | ||
|
|
||
| type nonceKey nonce.Key |
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
type nonceKey is unused (unused)
|
|
||
| type nonceKey nonce.Key | ||
|
|
||
| func (k nonceKey) NonceKey() nonce.Key { return nonce.Key(k) } |
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
func nonceKey.NonceKey is unused (unused)
Related issue(s)
closes #2892
Checklist
Description
This PR introduces support for DPoP (RFC 9449) and enables heimdall to automatically detect DPoP-bound tokens and validate them according to the RFC.
DPoP Configuration Options
Fine-grained control over PoP validation and behavior is provided via a new
proof_of_possessionproperty. This property extends the existingassertionsconfiguration used by both thejwtandoauth2_introspectionauthenticators.Error Signaling Update
This PR also extends error signaling for both authenticators. When enabled, heimdall emits error challenges as defined by the DPoP RFC:
WWW-Authenticateheader will be set toDPoP.nonce_requiredis enabled, but the DPoP proof does not contain a valid nonce, theerrorwill be set touse_dpop_nonceand theDPoP-Nonceheader with a new nonce will be included in the response.NOTE: If
nonce_requiredis set to true, a master key must be configured for nonce generation and validation (see below). Otherwise, heimdall will refuse to start (or reject the rule if configured at the rule level).Authorizationheader scheme, etc.), theerrorwill be set toinvalid_dpop_proof.If error signaling is configured to include error details, the
error_descriptionfield will contain additional details.Master Key Settings for Nonce Generation and Validation
Nonces are generated and verified using a symmetric (master) key. For this purpose, a new top-level configuration property has been introduced: TODO