google cloud platform – How to set up a persistent access token for service account?
I am trying to connect Google’s Vertex AI API to a desktop app written in C++ using their REST APIs. Auth token is part of the process. Being very distant from devops and GCP tech in general I wonder how I can solve the problem of the access token expiration which happens one hour after generation. I did the following:
- Created a service account.
- Generated a service access key in JSON format and downloaded it to my PC.
- Using
gcloud auth print-access-tokencommand generated access token which I copy-paste into the app to be used part of the REST payload sent to the API.
I read somewhere it is should be possible to configure token expiration to longer period of times when using service account. How?
Another question is,in case service account doesn’t allow creation of non expiring access tokens, how can I make it being refreshed automatically from withing the App? How do GPC driven App normally handle this scenario?
Read more here: Source link
