From 43c8a3d77d9b5831d43f04edbc9b06949562b00f Mon Sep 17 00:00:00 2001 From: Elmar Athmer Date: Thu, 28 May 2020 12:41:10 +0200 Subject: [PATCH] fix 'subject' name in service-account claim As indicated by https://developers.google.com/identity/protocols/oauth2/service-account#httprest the name for the subject-field inside the JWT claim needs to be named 'sub' (instead of 'subject'). This is relevant e.g. for the GSuite Admin Directory API. --- src/service_account.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/service_account.rs b/src/service_account.rs index 81d4c6e..933811d 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -92,6 +92,7 @@ struct Claims<'a> { aud: &'a str, exp: i64, iat: i64, + #[serde(rename = "sub")] subject: Option<&'a str>, scope: String, }