go-samples
go-samples copied to clipboard
Error Malformed auth code
hi there,
from this demo: https://github.com/googleworkspace/go-samples/blob/master/gmail/quickstart/quickstart.go
I got an error with message:
2023/03/29 14:40:18 Unable to retrieve token from web: oauth2: cannot fetch token: 400 Bad Request Response: { "error": "invalid_grant", "error_description": "Malformed auth code." }
After i copy the url redirect from browser and then enter in command line, It shows the above error
In my case it does open the authentication web page but at the end it redirects to an incorrect webpage:
http://localhost/?state=state-token&code=XXXXXXXXX&scope=https://www.googleapis.com/auth/gmail.readonly
Code parameter censured for obvious reasons.
In my case it does open the authentication web page but at the end it redirects to an incorrect webpage:
http://localhost/?state=state-token&code=XXXXXXXXX&scope=https://www.googleapis.com/auth/gmail.readonlyCode parameter censured for obvious reasons.
There is an workaround for this, I had the same problem: https://github.com/googleworkspace/go-samples/issues/76#issuecomment-1304902886