I'm currently using the following code to authenticate as a service account:
const auth = new google.auth.GoogleAuth({
keyFile: "<path/to/credentials>",
scopes: [<scopes>],
});
Is there a way to authenticate using a JSON object containing the same content as the keyFile? For example, doing something like this:
const credentials = {
"type": ...,
"project_id": ...,
"private_key_id": ...,
"private_key": ...,
"client_email": ...,
"client_id": ...,
"auth_uri": ...,
"token_uri": ...,
"auth_provider_x509_cert_url": ...,
"client_x509_cert_url": ...
}
const auth = new google.auth.GoogleAuth({
keyFile: credentials,
scopes: [<scopes>],
});