I’m having an issue with Oauth2 token refresh with Zoho Phonebridge API. After 1 hour from the original access_token being issued, I get an error when trying to run any workflows.
I have added a parameter of access_type=offline and set the grant type as Authorization Code
According to the Zoho Phonebridge docs, here is how the auth header should be constructed for requests:
To use this access token, you need to construct a normal HTTP request and include it in an Authorization header along with the value of “Bearer”.
What is the error message (if any)?
Error: Request failed with status code 400
Please share the workflow
Here is the Oauth2 credentials:
Here is the workflow:
I’ve tried setting this up both with Generic Oauth2 api creds entered, as well as using the Predefined Zoho Oauth2 creds.
Information on your n8n setup
n8n version: 0.204.0
Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm
Hi @jhambach, from reading your message I am not sure what would cause the refresh to fail here. From taking a look at n8n/NodeExecuteFunctions.ts at b71295e4de658fb134b67eaa0b630704f858ce7e · n8n-io/n8n · GitHub, any error in an authenticated request should trigger the refresh. Last time I checked n8n wasn’t logging any details around the OAuth2 refresh though, so these issues are rather tricky for me to understand.
Perhaps @RicardoE105 knows what might be the problem here?
As for reading your access and refresh tokens, this would work through the CLI for example:
I think I may have a temporary workaround by manually refreshing the token from what you gave me @MutedJam. By using the refresh_token provided from the workflow you gave me, I can refresh the token with Refreshing Access Token | Online Help - Phonebridge API