I created a service account with the roles: Document AI Administrator and Service Account Key Admin.
However, when I try to fetch an access token using googleauth (1.7.0) Ruby gem, i get the following error:
Signet::AuthorizationError (Authorization failed. Server message:)
{"error":"invalid_grant","error_description":"Invalid JWT Signature."}
Here's my code that I'm running locally on my command line:
scope = 'https://www.googleapis.com/auth/cloud-platform'
authorizer = Google::Auth::ServiceAccountCredentials.make_creds(
json_key_io: File.open('path_to_private_key_file_of_service_account.json'),
scope: scope)
authorizer.fetch_access_token!
I can get this to work when I have a user that has "ALL" permissions granted, so I know it's a permissions issue, but I don't know which roles/permissions are needed to request the access token. ?