OAuth2 API: refresh token URL different

Describe the problem/error/question

I am interfacing with an API that will be called periodically with a cron node. The Oauth2 token expires after 30 minutes and therefore I am relying on the OAuth2 API to automatically refresh my token.

The API uses a different refresh URL to the one used to retrieve the token from. There’s no way to specify a different refresh URL (auth/refresh in my case) in the OAuth2 credential though.

It tries to refresh the token as expected but the token URL doesn’t accept the refresh_token and throws this error:

{"status":"rejected","reason":{"body":{"error":"unsupported_grant_type","error_description":"The authorization grant type is not supported by the authorization server.","hint":"Check that all required parameters have been provided","message":"The authorization grant type is not supported by the authorization server."},"code":"EAUTH"}}

Is there a way to work around this without modifying or adding custom logic to the HTTP node to use a different refresh URL?

Information on your n8n setup

  • **n8n version:**0.213.0
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: AWS EC2 instance (Linux)

Hey @lucianblignaut,

At the moment for that you would need to build out your own logic but this kind of request makes sense as it has popped up a few times. I will get it added to our internal idea tracker.

1 Like

Thanks Jon, appreciate it :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.