NNarya Developers

Authentication

A terminal holds no credential until it is activated.

  1. An operator issues a one-time activation code for the terminal in Narya. The code is 8 digits and expires 15 minutes after it is issued. Issuing a new code cancels the previous one.
  2. The installer enters the code on the terminal.
  3. Your software calls POST /device/v1/activations with the code and the terminal's identifier. This is the only call that needs no credential.
  4. The response contains the terminal's device token. Store it in secure storage on the terminal. It is returned only once.
  5. Send the token on every other request, in an Authorization: Bearer <token> header.

A token cannot be recovered. If it is lost, or a request is answered 401, activate the terminal again with a new code. Each activation revokes the token the terminal held before.

The token does not expire. It stops working when the terminal is:

  • activated again
  • deactivated in Narya
  • decommissioned
  • deleted

A suspended terminal keeps its token. Until an operator resumes it, its requests are answered 409, except logs, which it can still send. It cannot be activated while suspended.

A decommissioned terminal gives up its serial number and never connects again. To use the hardware again, an operator registers it as a new terminal and issues a new activation code.