You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every, but the first call to any google API will not use the impersonated service account and thus calls will fail with permission denied.
Description
The getLastReceivedToken method in the ExternalAccountCredentials class does not return the last received token, if $this->serviceAccountImpersonationUrl is beeing used.
The RequestWrapper that is beeing used by almost all official gcp client libraries will enforce the credential fetchers to be wrapped in a FetchAuthTokenCache instance.
The FetchAuthTokenCache instace will use updateMetadata to inject the access tokens in e.g. http calls. To do that it's using fetchAuthTokenFromCache to fetch the cache. But using getLastReceivedToken to get the token to cache.
Since getLastReceivedToken does not return the service account token, every call but the first, will not use the service account token and thus this functionality will fail.
I'd be really happy if you could look into this :)
Thanks a lot in advance and best,
Marvin
The text was updated successfully, but these errors were encountered:
Hi team!
The issue below is currently blocking us from using the servcie account impersonalisation together with the workload identity federation.
We would be really happy if you coul look into that. Thanks!
Environment details
Steps to reproduce
Using federated workload access, with serviceaccount impersonalisation
Code example
Env
/etc/workload-identity/credential-configuration.json
isWhat happens
Every, but the first call to any google API will not use the impersonated service account and thus calls will fail with permission denied.
Description
The
getLastReceivedToken
method in theExternalAccountCredentials
class does not return the last received token, if$this->serviceAccountImpersonationUrl
is beeing used.The
RequestWrapper
that is beeing used by almost all official gcp client libraries will enforce the credential fetchers to be wrapped in aFetchAuthTokenCache
instance.The
FetchAuthTokenCache
instace will useupdateMetadata
to inject the access tokens in e.g. http calls. To do that it's usingfetchAuthTokenFromCache
to fetch the cache. But usinggetLastReceivedToken
to get the token to cache.Since
getLastReceivedToken
does not return the service account token, every call but the first, will not use the service account token and thus this functionality will fail.I'd be really happy if you could look into this :)
Thanks a lot in advance and best,
Marvin
The text was updated successfully, but these errors were encountered: