Production getOAuthToken() Returns gsmtestuser@marketplacetest.net Instead of Effective User

25 views
Skip to first unread message

D

unread,
Sep 28, 2025, 12:40:10 PMSep 28
to Google Apps Script Community

Hi,

I built a GAS that, after installation, exchanges the OAuth token of the effective user with my backend using ScriptApp.getOAuthToken(). 

This process automatically registers the user if they haven’t been registered yet (or updates their token if they have). 

It worked well for me in development, but in production, when I call getOAuthToken(), the result is tied to gsmte...@marketplacetest.net with a different user ID, instead of the effective user. 

Why is it happening? Does exchanging tokens from the GAS to your backend with getOAuthToken is a best practice ?

D

unread,
Sep 28, 2025, 1:51:34 PMSep 28
to Google Apps Script Community
Reply all
Reply to author
Forward
0 new messages