The purpose of authentication is to make sure the users are valid and the identity is known on t6 platform. This authentication process on t6 IoT can be done using multiple ways depending on the use-case.
HTTP Basic Authentication can only be used in the Web Sockets use case. This process expect a socket connection to t6 using an extra Autorization Header with the base64 encoded credentials as value. Credentials is a base64 string made from user-Api-Key : user-Api-Secret
Authorization: Basic dXNlci1hcGkta2V5OnVzZXItYXBpLXNlY3JldA==
t6 follows JWT basic concept so that Clients are claiming who they are using a server signed Jwt. t6 allows multiple process to generate such Jwt tokens. Each Jwt token last 5 minutes before expiration and a refresh token mechanizme is also available within a 24 hours period of time.
By providing a valid username + password
This process is the common password grant_type and require the user to sign in by providing his username (email address) and password. Once the identification on t6 server is done and successful, a Jwt token is forged and sent back to the user. Then, on every next call from that user (before token expires), the client should sent that Jwt token on the headers to claims who the requester is. t6 server will reject malformed or non valid signature Jwt token. Only t6 server can sign the token with the valid signature.
Please note username and password are sent from the client to t6 using SSL.
t6 provide a dedicated endpoint to generate Key+Secret Tokens. Those tokens allows to define a custom memo so that you can remember where you are using the Key+Secret credentials. Additionally, you can customize the duration (1 day, 1 week, 1 month or 1 year).
Key+Secret can also be revoked in case you don’t need them anymore or when you needs credential to become invalid (for security purpose for instance).
POSTing Key+Secret credentials to t6 Authenticate process will also forge a regular Jwt Token with the same attributes as the other processes.
Beta : Key+Secret credentials can also be sent directly on the X-headers specifically on the datapoint.
Whatever the identification process, t6 will send back a Jwt Token as well as a refresh token. Both are having their own expiration (5 min for Jwt and 24 hours for refresh_token). This Refresh Token can be used to get a fresh Jwt Token.
More info about t6 IoT platform :