I’m trying to run a node.js program that retrieves the labels from my GMail account. The build instructions (so you can see what I did) and code are here : https://github.com/chrisxkeith/gcp-js-credential-test .
After reading https://cloud.google.com/docs/authentication#strategies , it seemed to me that using application-default credentials was the best (e.g., simplest and most secure) way to go.
I’ve been able to use the application-default credentials to access the Cloud Storage service (https://github.com/chrisxkeith/gcp-js-credential-test/blob/main/test_cloud_storage.js ), but when I try to use the GMail service to retrieve the list of labels (https://github.com/chrisxkeith/gcp-js-credential-test/blob/main/test_get_email_labels.js ), I get an “Insufficient Permission” error.
How can I get past this error?