Complete two-factor authentication
POST/auth/user/auth2F
Base URL: https://api.tinkermode.com
For a user who has activated two-factor authentication, they must complete their authentication by providing a time-based one-time passcode (TOTP) from their authenticator, along with the token obtained in the previous authentication step (supplying an email and a password) If the TOTP is incorrect, the client may retry with the same token, up to 5 tries in all, until the token's expiration (3 minutes from issuance).
Authentication
This endpoint does not require authentication.
Request body
Content type: application/x-www-form-urlencoded
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
auth2FToken | string | Yes | Token obtained from the previous step of authentication. | |
code | string | Yes | Time-based one-time passcode from an authenticator application. |
Request example
code=889200&auth2FToken=XXXXXXXXXXXXXXXXResponses
200 User is successfully authenticated and an API token is issued.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
auth2FToken | string | No | read-only (server-generated) | Token used for completing the two-factor authentication process. Token will expire within 3 minutes |
expirationTime | string | No | read-only (server-generated); format: date-time | This property is present if token has an expiration time. |
sudoer | string | No | read-only (server-generated) | This property is present if client is authenticated via sudo. |
token | string | No | read-only (server-generated) | Access token to be used in the HTTP Authorization header in future API requests. |
userId | integer | No | read-only (server-generated) | This property is present if token is associated with a user. |
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit. The reason is TOO_MANY_AUTH2F_ATTEMPTS when the user has
entered more than 10 codes in 15 minutes, across all of their tokens, without a right one. Retry
after the number of seconds in Retry-After.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |