-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Let DPoP draft standard supplant client_signing_key (#10)
### MINOR Update: Explicitly supporting [IETF DPoP Draft Proposal](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop) * This proposal aligns our Proof of Possession of the access token with the current IETF DPoP draft proposal. This includes: * Deprecating storing the entire key in the `tdf_claims.client_public_signing_key` subclaim * Store a SHA-256 hash of the key in the `cnf.jkt` field, per the current draft proposal * Submit a DPoP in the `DPoP` header, which will include the complete key and request identifying information * Not included: * To get complete support for the missing functionality we may desire to add a body hash to the DPoP claims list, which will provides an additional check for partial message integrity. A reference implementation of this change is now included with opentdf/backend and opentdf/client-web. If accepted we will port this to the remaining opentdf/client-*. #### Reference Implementation Details ##### Client Implementation For the client, we use [an existing DPoP implementation](https://www.npmjs.com/package/dpop) to generate proofs. To use, we added a parameter (dpopEnabled) to the clients, and if present make this required. Implementation: opentdf/web-sdk#118 ##### Identity Provider Implementation (Access Token Generation) Our reference IdP, Keycloak, provides a java plugin environment for adding claims to access tokens. Our current reference implementation extended our existing plugin, which adds the `tdf_claims` claim, to include the `cnf.jkt` claim when there is a DPoP header in the code exchange. Reference: https://github.com/opentdf/backend/blob/9603538287e23240c6d40ea596cf42f8b26bfcc4/containers/keycloak-protocol-mapper/custom-mapper/src/main/java/com/virtru/keycloak/TdfClaimsMapper.java#L292 ##### Access Point Validation (KAS) KAS currently uses application level validation of the OIDC header. We extended this to include the DPoP check iff the access token includes the `jkt` claim. https://github.com/opentdf/backend/blob/9603538287e23240c6d40ea596cf42f8b26bfcc4/containers/kas/kas_core/tdf3_kas_core/dpop.py#L55 Co-authored-by: Ben Leggett <[email protected]> Co-authored-by: b-long <[email protected]>
- Loading branch information
1 parent
4a4215a
commit c6592ba
Showing
4 changed files
with
65 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.1.0 | ||
4.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Proof of Possession | ||
|
||
In order to allow extended offline flows, and to deal with potential leaks of bearer tokens, | ||
we enforce the use of proof of token possession, as currently described in | ||
[this IETF draft](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop). | ||
|
||
## What is this? | ||
|
||
The proof of possession works by having the client generate an ephemeral key pair, which it | ||
then associates with an access_token via a code or token exchange. This produces | ||
an access token with an explicit binding (via the `cnf` claim) to the public | ||
key of the value. Then, the client can issue DPoP proofs that will be allow servers | ||
to trust that the client has possession of the private key. | ||
|
||
## How does it work? | ||
|
||
1. TDF clients may request an OIDC requests an OIDC Bearer Token (either on behalf of itself, or another entity) | ||
by first authenticating via the | ||
OpenID Connect (OIDC) Identity Provider (IdP), | ||
passing along a signing key with the request. | ||
In some scenarios, a key may be added using an exchange or refresh. | ||
|
||
2. The client requests a decrypt from the Key Access Server (KAS), | ||
presenting its annotated JWT with PoP proof and entitlement claims in the access token. | ||
|
||
## Example | ||
|
||
```javascript | ||
TK | ||
``` | ||
|
||
## DEPRECATED: Validating with the `client_public_signing_key` | ||
|
||
Previously (<4.2) we stored the entire public key within the `tdf_claims` as the client_public_signing_key and used that to sign the request body. IdPs *may* include both the `cnf` hash of the public key and the `client_public_signing_key` subclaim for compatibility with older KAS services. |