From 1d5a1342089816fd7b6d61f3416e0a6c9e21cda4 Mon Sep 17 00:00:00 2001 From: Robert Jacob Date: Wed, 4 Sep 2024 00:51:52 +0200 Subject: [PATCH] Update token-file description --- doc/token-file.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/token-file.md b/doc/token-file.md index 1d78662..31b335d 100644 --- a/doc/token-file.md +++ b/doc/token-file.md @@ -12,7 +12,7 @@ The exporter uses a "token file" to save the authentication information it recei ## Attributes -All of the three attributes are necessary for the exporter to work correctly, but they have different purposes: +All the three attributes are necessary for the exporter to work correctly, but they have different purposes: - `access_token` this is the "key" that is used to communicate with the NetAtmo API and fetch the data available for the user. It is only valid for a limited time after which the API will return a 403 error when the access-token is used. - `expiry` this is the time when the `access_token` will expire. The exporter needs to know this, so that it can get a new access-token in time ("refresh" it). @@ -24,6 +24,8 @@ When starting the exporter it will try to load the file specified with `--token- If the token-file is available, it is read by the exporter. If all three attributes are available and the token is still valid, the exporter will immediately start working properly. +When the token expiry time has already passed, then it is ignored. The startup continues as if no token is present and the exporter will wait for the user to initiate authentication. + The exporter will issue warnings if the token-file is missing attributes during startup. If the `expiry` is missing a new short expiry will be set, so that the refresh happens as early as possible. If the `refresh_token` is missing during the startup of the exporter, it will issue a warning that it can not automatically refresh the token. It will continue to work normally until the `access_token` expires after which the user needs to initiate a new authentication. The exporter can not automatically recover from this case.