Reputation: 143
I created a endpoint on Google Cloud Platform Vertex AI and I managed to consume it with Postman with the following authentication process:
gcloud auth login
gcloud auth print-access-token
This token is only valid one hour.
How can I remove this repetitive manual authentication ? Could you describe another process for setting up automatic authentication ?
Upvotes: 0
Views: 1692
Reputation: 143
To my knowledge, the best way is to define a service account (SA), use its key (which never expires) and a Javascript pre-request script:
Upvotes: 0
Reputation: 1377
There is a documentation about token's lifetime here.
By default, access tokens are good for 1 hour (3,600 seconds). When the access token has expired, your token management code must get a new one.
If you need an access token with a longer or shorter lifetime, you can use the serviceAccounts.generateAccessToken method to create the token. This method enables you to choose the lifetime of the token, with a maximum lifetime of 12 hours.
Upvotes: 1