...
The JWT's header, payload, and signature are concatenated with periods (.
). As a result, a JWT typically takes the following form:
...
Code Block |
---|
{ "alg": "RS256", "typ": "JWT" } |
For Elliptic Curve elliptic curve keys:
Code Block |
---|
{ "alg": "ES256", "typ": "JWT" } |
...
Name | Description | Required for |
---|---|---|
| ("Issued At")at: The timestamp when the token was created, specified as seconds since 00:00:00 UTC, January 1, 1970. The server may report an error if this timestamp is too far in the past or future (allowing 10 minutes for skew). | MQTT, HTTP |
| ("Expiration"): The timestamp when the token stops being valid, specified as seconds since 00:00:00 UTC, January 1, 1970. The token’s maximum lifetime is 24 hours + skew.
| MQTT, HTTP |
| ("Audience"): This must be a single string containing the cloud project ID where the device is registered. The authentication will only be allowed with further analysis if the connection request matches this project ID. | MQTT |
| (“System Key”)System key: This must be a single string containing the ClearBlade Registry’s System Keyregistry’s system key. This can be obtained by clicking the API Keys keys button (key icon) at the top-right of the ClearBlade Registry Details page of the ClearBlade Registry. | HTTP |
| (“User ID”)User ID: This must be a single string containing the deviceId. | HTTP |
| (“User Type”)User type: This must be an integer hard-coded to value 3. | HTTP |
The nbf
("Not Before"not before) claim will be ignored and is optional.
...
The JSON Web Signature (JWS) specification guides the mechanics of generating the JWT signature. The signature’s input for the signature is the following content’s byte array:
...
Refreshing JWTs
As described in required Required claims, tokens have expiration dates. If a device is connected over MQTT and its token expires, it automatically disconnects from ClearBlade IoT Core. You can prevent the device from disconnecting by automatically refreshing its token.