Open RYenike opened 6 days ago
Hi @RYenike, thanks for reporting this.
IIUC you are trying to pass your own Application Default Credentials JSON file to create a credentials object, but please be aware that GoogleCredentials
has its own getApplicationDefault()
method:
GoogleCredentials credentials = GoogleCredentials.getApplicationDefault()
This should be enough to build a client.
Moreover, our clients libraries default to use the Application Default Credentials even if not specified in your code. This can be achieved by running gcloud auth application-default login
before running your code.
Please let us know if using the built-in getApplicationDefault
or the gcloud
command worked for you.
Hello @diegomarquezp I don't want to use getApplicationDefault , as I will be running my code on another machine which is not having google cloud CLI installed in it, also in specified adc.json they are service account credentials got from secret manager -> Secrets , so I want to use that service account credential to authenticate Please suggest
Environment details
Steps to reproduce
Getting null in getAccessToken after giving Service Account Secrets Json
Code example
Below is pom.xml
Stack trace
External references such as API reference guides
Any additional information below
Following these steps guarantees the quickest resolution possible.
Thanks!