Google Get Token

POST https://oauth2.googleapis.com/token

Here we just pass in the required information about the service account and scopes we want to touch. Then sign the payload and send it over for an access token.

//iss: email address of service account //scope A space-delimited list of the permissions that the application requests. //aud A descriptor of the intended target of the assertion. When making an access token request this value is always https://oauth2.googleapis.com/token. //exp The expiration time of the assertion, specified as seconds since 00:00:00 UTC, January 1, 1970. This value has a maximum of 1 hour after the issued time. //iat The time the assertion was issued, specified as seconds since 00:00:00 UTC, January 1, 1970.

https://developers.google.com/identity/protocols/OAuth2ServiceAccount#makingrequest

https://gist.github.com/dinvlad/425a072c8d23c1895e9d345b67909af0

Request Body

[{"name"=>"grant_type", "value"=>"urn:ietf:params:oauth:grant-type:jwt-bearer", "datatype"=>"string"}, {"name"=>"assertion", "value"=>"{{jwt}} ", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring