-
Notifications
You must be signed in to change notification settings - Fork 8
Authentication issues #55
Description
I've noticed that tokens were "refreshed" every 25 seconds, where they are currently valid for 3 hours (10800 seconds). You will get that expiration span in the response of https://api.netatmo.com/oauth2/token in expires_in and expire_in. This is likely to clutter up their memory for valid access IDs.
Furthermore refreshing is implemented as first retrieval of the access token (transfering username, password, client_id and client_secret every 25 seconds). This is highly controversioal in terms operational security and an anti-pattern for oauth2. You should rather use the refresh_token to get a fresh access_token every $now + $expires_in - $threashold. It's also documentated in their api documentation: https://dev.netatmo.com/apidocumentation/oauth#refreshing-a-token