Last active
February 13, 2023 17:43
-
-
Save scarabaeus/9e6a9bbaab1fe227b4630ca349571dbd to your computer and use it in GitHub Desktop.
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
{ | |
'grant_type': 'urn:ietf:params:oauth:grant-type:jwt-bearer', | |
/* Custom JSONata-registered JWT creation function ($createSignedJwt is just a pass-through wrapper on top of jsonwebtoken) */ | |
'assertion': $createSignedJwt({ | |
/* Service account email */ | |
'iss': '{{client_email}}', | |
/* Google scoped service (url format) */ | |
'scope': $.scope, | |
/* The Google Auth URL */ | |
'aud': 'https://www.googleapis.com/oauth2/v4/token', | |
/* Issued At (now) */ | |
'iat': $round($toMillis($now()) / 1000), | |
/* Expiration - Must be exactly 3600 seconds from iat */ | |
'exp': $round($toMillis($now()) / 1000) + 3600, | |
/* Subject email -- for impersonation */ | |
'sub': $.subject | |
}, | |
'{{private_key}}', | |
{ | |
'algorithm': 'RS256' | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment