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

PropertyTypeRequiredConstraintsDescription
auth2FTokenstringYesToken obtained from the previous step of authentication.
codestringYesTime-based one-time passcode from an authenticator application.

Request example

code=889200&auth2FToken=XXXXXXXXXXXXXXXX

Responses

200 User is successfully authenticated and an API token is issued.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
auth2FTokenstringNoread-only (server-generated)Token used for completing the two-factor authentication process. Token will expire within 3 minutes
expirationTimestringNoread-only (server-generated); format: date-timeThis property is present if token has an expiration time.
sudoerstringNoread-only (server-generated)This property is present if client is authenticated via sudo.
tokenstringNoread-only (server-generated)Access token to be used in the HTTP Authorization header in future API requests.
userIdintegerNoread-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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.