Issue with OAuth2.0 Token Refresh for Netatmo Connect Integration

Describe the problem/error/question

Hello everyone,

I’m encountering an issue with the OAuth authentication for Netatmo within n8n. The initial authentication process completes successfully, allowing me to access the necessary data. However, after approximately 3 hours, the access token expires, and authentication subsequently fails. The token does not refresh automatically, which disrupts the workflow and prevents it from functioning as intended.

What is the error message (if any)?

When the token expires, I receive an error through my error email workflow : “Forbidden - perhaps check your credentials?

Please share your workflow

Below is an overview of my current workflow setup:

Share the output returned by the last node

After the token expires, the Netatmo node returns the following output:

Netatmo OAuth2.0 Configuration

Here are the screenshots of my Netatmo OAuth2.0 configuration:



Additional Reference

For your reference, here is the Netatmo authentication documentation I followed:
https://dev.netatmo.com/apidocumentation/oauth

Information on your n8n setup

  • n8n version: 1.72.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own,main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Synology NAS

What I’ve Tried So Far

  1. Verified OAuth2 Credentials: Ensured that all OAuth2 credentials are correctly entered and match those provided by Netatmo.
  2. Checked Token Expiry Settings: Reviewed the token expiry settings in both n8n and Netatmo to ensure they align.
  3. Reviewed Logs: Examined n8n logs for any additional error messages or hints about the token refresh failure.
  4. Consulted Netatmo Documentation: Cross-referenced my setup with the official Netatmo OAuth documentation to identify any discrepancies.

Request for Assistance

I’m unsure why the token isn’t refreshing automatically after expiration. Has anyone experienced a similar issue or can provide guidance on enabling automatic token refresh for Netatmo in n8n? Any insights or suggestions would be greatly appreciated!


Thank you in advance for your help! :pray:

Anyone to help me? :frowning:

I’m still stuck with this issue, the token is never refreshed… Nobody can help me to solve it out ?

I need help as I’m still facing issues. I plan to implement my own OAuth 2.0 authentication to verify that the token and refresh token I receive are valid and functioning correctly. Could this issue be related to a parameter configuration on my end, or is it potentially an OAuth 2.0 implementation issue with n8n?

I tried with the latest 1.75.2 version, still the same issue :

Still stuck with this error even with the 1.77.0 version… :frowning:


I built my own OAuth 2.0 authentication system with a refresh token, and it works flawlessly! It was the only viable solution I found until this issue is permanently resolved in a future version.

A few days ago, when updating tokens, I received this response.

Service unavailable

The request is blocked.

20250219T064647Z-15bb86fc579kqrnxhC1FRAk3h00000000fn000000000hrhk

What’s happened? How to fix this?

Hey @bNj

Expirying OAuth issues are always the trickiest to solve. I would imagine it’s not really an easy fix so you may want to look for a freelancer/developer to take a look.

I found these OAuth-related templates in the gallery which might hel.

Thank you for sharing your thoughts and the OAuth-related templates. I wanted to update you that the native OAuth implementation wasn’t handling the refresh token correctly for this specific API. To resolve the issue, I developed a custom OAuth authentication flow that properly utilizes the refresh token—and now it works pretty well!

Same issue with Shelly <> Netatmo Weather
After cca 3 hours tokens are expired and need to be manually obtained by dev.netatmo site.

Can you help me with this? Thank you

You seem to have exactly the same problem that I have.
Is it true that your refresh-token only lives 3 hours?
Luckily the refresh-token for my particlar case lasts 45 days.

scripts runs for 3 hours and than “authorisation” problem occured.
when I manualy refresh: access_token, and refresh_token, everything starst again.
Now trying to find some proper way to work with netatmo: authCode (singleUse) / access_token (3-hour expiry) / refresh_token (???)
I have headache from this.
and to be hones to all of you, I cant code - everthing is made by ClaudeSonet.

Well, I thought that the built-in OAuth2-module took the latest refresh-token so that wouldn’t be necessary.

I found this:

I understand this, but my skills are not as far as I need for this. So I have to “experiment” a lot.
And because skript runs on Shelly gen2 Pro DualCover, I have to optimise syntax. for me… lots of hard working

Hi there!
I’ve found that post after I googled the hell out. I’m facing the same problem and found no solution. In NodeRed I developed my own solution and store the token and refresh token in the global context. In n8n I noticed there are variables.
Your auth system looks pretty good. Can you provide this as a template?

@bNj I am facing exactly the same issue with MS SharePoint OAuth2 API. May I ask, how you impemented the custom OAuth2 authentication? In case you did that with n8n HTTP Request Node, would you be so kind to share just that particular part?

TIA

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