diff --git a/credentials/credentials.go b/credentials/credentials.go index e876bb5e..9bc4463c 100644 --- a/credentials/credentials.go +++ b/credentials/credentials.go @@ -213,11 +213,7 @@ type serviceAccount struct { } func (s serviceAccount) GetRequestMetadata(ctx context.Context) (map[string]string, error) { - c, ok := ctx.(oauth2.Context) - if !ok { - return nil, fmt.Errorf("credentials: the context %v is invalid", ctx) - } - token, err := s.config.TokenSource(c).Token() + token, err := s.config.TokenSource(ctx).Token() if err != nil { return nil, err }