The Data API Service documentation describes the route /whoami, which generates a Refresh Token that can be used to authenticate service calls and expires in seven days. This authentication pattern seems to be a subset of the OAuth protocol, which usually entails the authentication of a client with a server; the similarities are present, as I can only access the initial token by providing my username and password.
This style of authentication introduces an interesting pattern for server-to-server authentication. After accessing my initial API token, I can generate a refresh token which I can store with a timestamp to indicate when to refresh it. It requires a bit of work to consume this pattern, whereas I may be able to reuse an existing authentication pattern with less effort. For example, standard libraries exist to handle HMAC authentication and are built with server to server authentication in mind.
Does Resin provide a standard method of server to server authentication, such as HMAC authentication?
Hi @dagrooms52,
We are currently developing named api keys, which can be managed in the dashboard and can be used as authentication tokens. These tokens will not expire after a certain time, but can be revoked manually from the dashboard. Is this mechanisms something you had in mind?
Our team would also like to use non-expiring API keys, since our Resin calls are server-to-server and we would like to avoid adding logic to refresh the token. Are there any updates on adding this feature?
We are happy to let you know that you can now create API keys that do not expire from the Dashboard.
These API keys are named tokens that can be created / revoked as needed, and they can be used for authentication in the resin.ioAPI, CLI, and SDKs (Node.jsPython)