Google Workspace APIs · sdk · fg-0025

googleapis JWT client built with positional arguments is silently unauthenticated

If you see 401 or 403 on every call from a service account, the cause and the fix for Google Workspace APIs are below, last verified 2026-07-05.

Verified Jul 2026trust 55/100
Symptom
401 or 403 on every call from a service accountNo error when constructing the client
Cause
Newer googleapis versions expect the JWT constructor to take a single options object. Positional arguments are accepted without error but produce a client with no credentials.
Fix
Pass an options object.
Apply
new google.auth.JWT({ email: sa.client_email, key: sa.private_key, scopes: ['https://www.googleapis.com/auth/spreadsheets'] })
Affected
googleapis for Node v173 and later, July 2026

Last verified 2026-07-05 · Confirmed by 1 builder

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun