Fix JWT header missing the typ and kid fields

Signed-off-by: Olivier 'reivilibre <olivier@librepush.net>
This commit is contained in:
Olivier 'reivilibre' 2024-04-21 18:08:09 +01:00
parent b03dba825a
commit 9a855f094d

View File

@ -386,7 +386,12 @@ fn make_id_token(id_token: IdToken, secrets: &SecretConfig) -> eyre::Result<Stri
bail!("ID Token not a map");
};
let id_token_header = JwsHeader::new();
let mut id_token_header = JwsHeader::new();
id_token_header.set_token_type("JWT");
// The key ID is currently hardcoded as `thekey`; this is the same
// as on the JWKS endpoint.
id_token_header.set_key_id("thekey");
let id_token_payload =
JwtPayload::from_map(map).context("failed to make JWT payload for ID token")?;