I am trying to download a file from google drive using Google service account. For that I have created a project, created a service account and keys. Now when I am trying to use google auth api, It is returning undefined.
Please find the code below.
const scope = ["https://www.googleapis.com/auth/drive"];
const authService = new google.auth.GoogleAuth({
keyFile: "./service.json",
scopes: scope,
});
this is returning something like below,
GoogleAuth {
checkIsGCE: undefined,
jsonContent: null,
cachedCredential: null,
_cachedProjectId: null,
keyFilename: './service.json',
scopes: [ 'https://www.googleapis.com/auth/cloud-platform' ],
clientOptions: undefined
}
although service.json is in the same folder and copied the credentials from workspace itself.
Please let me know. Thanks