Access Tokens

Spoke Zone uses access tokens to authenticate API requests. Whenever a request is made, the token must not only be a real token but have the requisite permissions for making its request; in other words, different levels of tokens have varying levels of permissions.

There are two types of access tokens:

Usage

Whenever an API request is made, a valid access token must be included in its entirety in the x-access-token header.

To get your user token:

  1. Navigate to the Settings page via the nav menu.
  2. Click the section in the section selector.
  3. Ensure the token-hotkey feature flag is toggled on.
  4. Press the t key to copy your user token. This hotkey will work anywhere in the site.

To get the token for an MRS-supplied device:

  1. Access the file /etc/spoke-zone/spoke-zone.conf on the device.
  2. The device token is stored in the mqtt_username variable.
Contents

Go to jwt.io to parse the contents of an access token.

User tokens contain lots of information about the user: username, permissions, organization ID, etc.

Device tokens contain the device ID and MQTT publishing prefix.

AcquisitionUser Tokens

You can obtain a user access token via the following methods:

Device Tokens

You can obtain a device access token via the following methods: