Tokens
For integration with external applications, it may be necessary for a third-party application to validate the identity of a device. To this end, Nexigon Hub can issue device tokens which can then be used to validate the identity of a device via Nexigon's API.
Assume you have a custom application (Your App) running on devices that is connected to some backend (Your Backend) and would like to link the device to a user account in your application and backend. To associate a device with a user account in your app and backend, the app will request a device token from Nexigon Agent. It will then send this token to your backend. The backend will validate the token by sending it to Nexigon Hub. When the validation is successful, Nexigon Hub will return the device id. You can then store this device id in your backend, e.g., to establish a permanent association between the user and their device.
To issue a device token, run:
nexigon-agent device tokens issue
By default, device tokens are valid for 10 minutes.
You can also attach specific claims to the token and change its validity period:
Issue a device token
Usage: nexigon-agent device tokens issue [OPTIONS]
Options:
--valid-for <VALID_FOR> Seconds for which the token should be valid
--claims <CLAIMS> Additional JSON claims to attach to the token
-h, --help Print help
To avoid conflicts between tokens used for different purposes, we always recommend specifying specific claims. Not doing so may expose you to security risks, where tokens can be used for a different purpose than they have been issued for.