Skip to content

Commit

Permalink
AS: move JWK to the JWT Header field
Browse files Browse the repository at this point in the history
Due to RFC 7515, JWK should be part of a JOSE Header rather than claim
body.

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Oct 9, 2024
1 parent 799884e commit 8c0cfe5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attestation-service/src/token/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ impl AttestationTokenBroker for SimpleAttestationTokenBroker {
let header_value = json!({
"typ": "JWT",
"alg": SIMPLE_TOKEN_ALG,
"jwk": serde_json::from_str::<Value>(&self.pubkey_jwks()?)?["keys"][0].clone(),
});
let header_string = serde_json::to_string(&header_value)?;
let header_b64 = URL_SAFE_NO_PAD.encode(header_string.as_bytes());
Expand All @@ -109,7 +110,6 @@ impl AttestationTokenBroker for SimpleAttestationTokenBroker {
"iss": self.config.issuer_name.clone(),
"iat": now.unix_timestamp(),
"jti": id,
"jwk": serde_json::from_str::<Value>(&self.pubkey_jwks()?)?["keys"][0].clone(),
"nbf": now.unix_timestamp(),
"exp": exp.unix_timestamp(),
})
Expand Down

0 comments on commit 8c0cfe5

Please sign in to comment.