JSON API » people » people/totp/verify
Verifies a TOTP code for a person. Use this after setting up TOTP to confirm the authenticator app is correctly configured before enforcing two-factor authentication at login.
Input parameters
Requires authentication and the user role privilege. A user may verify their own TOTP code. An admin may additionally verify the TOTP code for any person in their customer.
| Name | Type | Description | Required | Default value |
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| auth_code | String | 6-digit TOTP code from the authenticator app. | Yes | |
| id | Integer | ID of person to verify TOTP for. Admins may specify another user's ID. | No | Logged-in user. |
Responses
| Code | Description |
|---|---|
| 200 | Success. The TOTP code is valid. |
| 400 | The TOTP code is invalid, or the person has no TOTP secret configured. |
| 401 | The authentication details provided are invalid. |
| 402 | Your role does not allow this. |
| 404 | The person does not exist, or you do not have permission to view them. |
Example: Verify TOTP code for logged-in user
http://enswitch.example.com/api/json/people/totp/verify/?auth_username=user;auth_password=password;auth_code=123456{ "responses":[ { "code":"200", "key":"", "message":"OK" } ] }
Change history
| Version | Changes |
|---|---|
| 4.4 | Function added. |
