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.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
auth_codeString6-digit TOTP code from the authenticator app.Yes
idIntegerID of person to verify TOTP for. Admins may specify another user's ID.NoLogged-in user.

Responses

CodeDescription
200Success. The TOTP code is valid.
400The TOTP code is invalid, or the person has no TOTP secret configured.
401The authentication details provided are invalid.
402Your role does not allow this.
404The 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

VersionChanges
4.4Function added.