I want to get a generic token for a default service account. I have used the below command to get the token to get the token
gcloud auth print-identity-token projectId@appspot.gserviceaccount.com
I want to get this token programmatically. I have tried getting this token using google-auth-library but it takes the audience as cloud function url. I want to get a generic token which authenticates all cloud function, like maybe using projectId as audience.
Is there any other way to get the token or is there a way to get the generic token for the service account?