Hi community,
I have setup CANVA API via http node, and it works fine but for some reason, everyday or possibly every few hrs within the same day, the connection comes back with “read ECONNRESET”.
error:invalid_grant
error_description:Refresh token used twice. All access tokens granted from this flow are now revoked.
I understand API generally requires some kind of refresh token to ensure continuous connectivity but I would presume that’s carry out automatically based on my Oauth2 setup in n8n.
This is my setup
Created oauth2 with the following details:
*OAuth Redirect URL: http://127.0.0.1:5678/rest/oauth2-credential/callback
grant type = PKCA
authorize url = https://www.canva.com/api/oauth/authorize
access token url = https://api.canva.com/rest/v1/oauth/token
client id: my clientid
client secret:mysecret
scope: app:read app:write asset:read asset:write brandtemplate:content:read brandtemplate:meta:read comment:read comment:write design:content:read design:content:write design:meta:read design:permission:read design:permission:write folder:read folder:write folder:permission:read folder:permission:write profile:read
Auth URI Query Parameters: (I left this empty)
Authentication: header
Upon setup, I click connect , it took me to the canva authorization page, I authorized it and then it says connected successfully. I can then proceed to call CANVA endpoints for hours but the next time I try again, it spits that error.
I have similar Oauth2 setup for pinterest and it seems to be fine (in saying that, pinterest does not use grant type=PKCE, instead it uses AUTHORIZATION CODE).
The other thing to note, I have a line in my docker-compose
- WEBHOOK_URL=http://127.0.0.1:5678
This enable canva to reach my redirect url. Not sure if this has anything to do with the problem but if it does, it would have affected pinterest too?
This canva api page does mention something about refresh token (Generate an access token - Authentication - Canva Connect APIs Documentation)
but I would presume since I set it up with oauth2, the refresh should be done automatically?
Information on your n8n setup
- **n8n version: 1.97.1
- **Database postgres
- **Running n8n via (Docker docker compose)
- **Operating system:Ubuntu
Thank you all!