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
c.client=oauth2.NewClient(c.context, tokenSource) // c.client isn't initialised fully when this code is called.
377
+
378
+
email, err:=GetCurrentUserEmail(c, c.userAgent)
379
+
iferr!=nil {
380
+
log.Printf("[INFO] error retrieving userinfo for your provider credentials. have you enabled the 'https://www.googleapis.com/auth/userinfo.email' scope? error: %s", err)
381
+
}
382
+
383
+
log.Printf("[INFO] Terraform is using this identity: %s", email)
384
+
385
+
returnnil
386
+
387
+
}
388
+
389
+
// Drop Impersonated ClientOption from OAuth2 TokenSource to infer original identity
c.client=oauth2.NewClient(c.context, tokenSource) // c.client isn't initialised fully when this code is called.
396
+
397
+
email, err:=GetCurrentUserEmail(c, c.userAgent)
398
+
iferr!=nil {
399
+
log.Printf("[INFO] error retrieving userinfo for your provider credentials. have you enabled the 'https://www.googleapis.com/auth/userinfo.email' scope? error: %s", err)
400
+
}
401
+
402
+
log.Printf("[INFO] Terraform is configured with service account impersonation, original identity: %s, impersonated identity: %s", email, c.ImpersonateServiceAccount)
403
+
404
+
// Add the Impersonated ClientOption back in to the OAuth2 TokenSource
return"", fmt.Errorf("error retrieving userinfo for your provider credentials. have you enabled the 'https://www.googleapis.com/auth/userinfo.email' scope? error: %s", err)
0 commit comments