User authentication
Those endpoints allow to authenticate the User or Master based on passphrase.
info
These two endpoints are wide open and do not need any authorization data.
danger
The authentication procedure requires a valid RTC to be set.
Phase 1 - challenge
Get a challenge
GET
https://my.ence.do/api/auth/tokenGet a challenge data to perform user authentication based on it.
Response status code
- 200: Operation successful
- 403: Clock RTC not set
- 409: Incorrect internal state
- 412: Protocol error - CORS validation failed
- 500: Internal server error
{
"exp": 1647871504,
"spk": "0kRmCliUQvRwfxi7T1ek2GtbSERzMFRGLeyO1r1tEXo=",
"jti": "1IU4Yont+/lZxh+HpgBwsc2sOWybfByFI+n8vAxWQzU=",
"lbl": "My device",
"eid": "ff6/rpgprw6OjcPbedIB5LbsxjZqmnf43J1zeK1x82I="
}
No response body.
No response body.
No response body.
No response body.
Response data for successful operation
| Name | Type | Description |
|---|---|---|
exp | Number | Expire timestamp |
eid | String | EncedoID, public key of the instance. |
jti | String | Token id |
lbl | String | Label, username |
spk | String | Session public key |
Phase 2 - response
Post authentication data
POST
https://my.ence.do/api/auth/tokenPost-authentication data is signed based on the user's passphrase.
Headers
| Name | Type | Description |
|---|---|---|
| Content-Type* | String | application/json |
Request Body
| Name | Type | Description |
|---|---|---|
auth* | String | Authentication data to be validated by the device |
Response status code
- 200: Operation successful
- 400: Incorrect argument(s)
- 401: User not authenticated
- 403: Clock RTC not set
- 409: Incorrect internal state
- 411: Protocol error - Content-Length required
- 412: Protocol error - CORS validation failed
- 413: Protocol error - request body too big
- 500: Internal server error
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6ImxvZ2dlcjpnZXQiLCJzdWIiOiJVIiwiaWF0IjoxNjQ3ODcxNDQ1LCJleHAiOjE2NDc5MDAyNDUsImp0aSI6IjFZVTRZcG5WeTVyWGF1d3hUMklYUlg5MWhUQ3hhVUV0R2RPQksyNXpBNDA9In0.wlFlgdpP4bPxNZoPAGaPqqyV1yuri2-Z53l7B8CfcXU"
}
No response body.
No response body.
No response body.
No response body.
No response body.
No response body.
No response body.
No response body.
Response data for successful operation
| Name | Type | Description |
|---|---|---|
token | String | JWT access token (refered as JWT_TOKEN) |
Log entries
| Event | Result | Source |
|---|---|---|
| LOG_TYPE_AUTH_SUCCESS_INTERNAL | LOG_RESULT_OK | 200 |