Skip to content

Commit

Permalink
Update token-file description
Browse files Browse the repository at this point in the history
  • Loading branch information
xperimental committed Sep 3, 2024
1 parent dea192f commit 1d5a134
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/token-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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.
Expand Down

0 comments on commit 1d5a134

Please sign in to comment.