-
Notifications
You must be signed in to change notification settings - Fork 7
Implementing Two Factor Authentication
Guillaume Viguier-Just edited this page Oct 14, 2019
·
3 revisions
HID only supports 2 factor authentication via an application (such as for example Google Authenticator). 2FA via SMS is not supported and there is no immediate plan to support it in the future.
In order to enable 2FA via an application, your client application will need to use the following API methods in this order:
- POST /api/v2/totp/qrcode: this method will generate a QRCode (as a base64 image URL). This QRCode will need to be read by Google Authenticator (or any other 2FA application) so that the 2FA key can be added to the user's 2FA application.
-
POST /api/v2/totp: call this method with, in the request payload
{method: 'app'}
and, in theX-HID-TOTP
header, the 2FA code. This will enable 2FA for the current user. -
GET /api/v2/totp: call this method with, in the
X-HID-TOTP
request header, the value of the 2FA code. If you get an empty 200 response, it means that the code is valid. This method is there for testing purposes only. - DELETE /api/v2/totp: call this method to disable TOTP