diff --git a/google/google.go b/google/google.go index 4d287ca..0594699 100644 --- a/google/google.go +++ b/google/google.go @@ -186,7 +186,7 @@ func (f *credentialsFile) tokenSource(ctx context.Context, params CredentialsPar } return cfg.TokenSource(ctx) case impersonatedServiceAccount: - if f.SourceCredentials == nil { + if f.ServiceAccountImpersonationURL != "" && f.SourceCredentials == nil { return nil, errors.New("missing 'source_credentials' field in credentials") }