Gmail OAuth2 credential fails during authorization on a self-hosted n8n instance. Google consent completes, but the callback to n8n returns 401 and the credential is not saved.
Unable to sign without access token (item 0)
Please share your workflow
{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
-144,
-64
],
“id”: “f5ed4428-70f0-4aff-be58-d21a7f464e7e”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“sendTo”: “”,
“subject”: “Hello world”,
“message”: “hi”,
“options”: {}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.2,
“position”: [
64,
-64
],
“id”: “ce479778-8fc6-4b61-90f2-9cca9e56bb55”,
“name”: “Send a message”,
“webhookId”: “87cce37e-a4a5-4b2c-8002-aae281b7f5e9”,
“credentials”: {
“gmailOAuth2”: {
“id”: “IgjZ0FDXNdIROb”,
“name”: “Gmail account 2”
}
}
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “Send a message”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “c43f3c92bc30e0361f030e683f98e30a3d105f252057ad90f7c5fc28f61e32de”
}
}
Share the output returned by the last node
No output. Authorization fails before workflow execution.
Information on your n8n setup
n8n version: 2.0.3
Database: SQLite
n8n EXECUTIONS_PROCESS: default (regular)
Running n8n via: Docker (self-hosted)
Operating system: Windows 10