OAuth2 invalid_grant: Malformed auth code (Google Sheets API)

Ben Rubinstein benr_mc at cogapp.com
Thu Jul 9 07:31:58 EDT 2020

I had code that did stuff with Google sheets, it worked fine, I haven't used 
it for about nine (?) months. Now it doesn't work.

To cut a long story short, I've started all over again on a clean base.

Created a new Client ID at

Make the call to Oauth2, with all the parameters from the Google creds, get a 
suitable authorisation screen, all seems to go OK. But the result (i.e. 'it') 
is set to the array:
	error: invalid_grant
	error_description: Malformed auth code.

OAuth2 is working for me with other services - e.g. Slack.

client_id and client_secret contain only a-z, 0-9, full stop and hyphen - 
nothing that might want to be encoded.

Redirect ID is registered both with and without a slash, because I've been 
caught that way before.

(My old code had an API Key, but the OAuth2 command doesn't take this as a 
param, so I don't think that's relevant at this point.)

Is anyone currently using the Google APIs successfully? Has anyone been 
through this before?

Any help gratefully received,


More information about the use-livecode mailing list