Device Tokens
Device tokens authenticate the Foxglove Agent to the rest of the system.
There are two different methods to manage device tokens:
- Create the device first
- Create the token first
In this method you create a device first, then create a device token corresponding to that device. The device token is locked to that particular device and can be used immediately.
To use this method, as an admin user:
- Go to the Devices page
- Create a new device or select an existing device
- Select the "Agent" tab
- Select "Create new token" to generate a secret token
- Save the token, which will be used during the installation of the Foxglove Agent
Admins can also create device tokens via the API.
Generate an API key with both the devices.create and deviceTokens.create capabilities from the API key settings page and use it to create device tokens.
In this method you create a device token in the Device Token Settings page, and don't associate a device with it. The first time the device token is used by the Foxglove Agent, it will create that device and the device token will be locked to that device. To prevent unintended behavior, this method can only be used when the device does not yet exist. If you have an existing device you want to create a device token for, use the other method.
To use this method, as an admin user:
- Go to the Device Tokens settings page
- Select "Create device token" to create a new token
- Leave the "Device" blank
- Click "Create"
- Save the token, which will be used during the installation of the Foxglove Agent
Device preapproval
When creating device tokens using this method, they can be created preapproved or not. If the device token is preapproved, then when the Foxglove Agent starts up the first time and creates the device, the device is immediately able to be used. If the device token is not preapproved, then an administrator needs to "Enable" the device on the Devices page before the Foxglove Agent is allowed to perform further actions.
Admins can also create device tokens via the API.
Generate an API key with the deviceTokens.create capabilities from the API key settings page and use it to create device tokens.
Each Agent installation requires its own unique device and device token. Multi-compute robots sharing a single device aren't supported.
Next install the Agent on your robot.