diff --git a/siopv2/src/relying_party.rs b/siopv2/src/relying_party.rs index 912bef9f..4fcba73f 100644 --- a/siopv2/src/relying_party.rs +++ b/siopv2/src/relying_party.rs @@ -36,13 +36,15 @@ impl RelyingParty { authorization_request: &AuthorizationRequest>, signing_algorithm: impl TryInto, ) -> Result { + let mut header = Header::new( + signing_algorithm + .try_into() + .map_err(|_| anyhow::anyhow!("Invalid signing algorithm."))?, + ); + header.typ = Some("oauth-authz-req+jwt".to_string()); jwt::encode( self.subject.clone(), - Header::new( - signing_algorithm - .try_into() - .map_err(|_| anyhow::anyhow!("Invalid signing algorithm."))?, - ), + header, authorization_request, &self.default_subject_syntax_type.to_string(), )