hi everybody, I recently try to read google chat api with pub/sub , for that I used app script to work with workspace api , I enable domain wide delegation and oauth for service account and I also create pub/sub topic.
after that the problems with default service account for cloud function(admin.initializeApp()) and deploying cloud functions started
then I tried to deploy cloud function with (firebase deploy --only functions:functionName) , each time I try to do that it gives error and request for some permissions for different servive accounts.
previously I had no problem for deploy cloud function and using default service account.
please can anybody say what is the possible problem, and why do I run into these issue ? and what is the solution ?
thanks in advance
May I know what specific error you are getting? It could be due to your service account not having the Service Account Token Creator role. Also, how do you authorize the service account? If via GOOGLE_APPLICATION_CREDENTIALS, make sure that you set the environment variable to the file path of the JSON file that contains your service account key and make sure that you generate a private key file for your service account in JSON format.
You can also try to run firebase logout followed by firebase login to refresh your Firebase authentication, this can sometimes resolve the issues with outdated credentials.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.