Multi-factor authentication
To improve security across emnify services, authentication with user credentials was deprecated and removed on March 28, 2024. Please authenticate with application tokens instead.
If you have multi-factor authentication (MFA) enabled for your account, authentication is performed in two steps:
- The first request submits user credentials (username and password) to return an
mfa_tokenin the response instead of the usualauth_tokenandrefresh_token. - The second request sends this
mfa_tokenand the generated one-time password (OTP) code to return theauth_tokenandrefresh_tokenin the response.
For the second request, provide the following fields:
mfa_token(String, required) - JSON Web Token (JWT) returned from the first requestcode(String, required) - OTP codetrusted_device(Object, optional) - Device details to determine if the second MFA step is skipped in the future
This data is stored if the second request is successful and includes the trusted_device object with the fingerprint, operating system, and browser.
Providing an MFA code is unnecessary if the device is already trusted.
So, if the first request includes a unique identifier (known as a “fingerprint”) for a device that matches the fingerprint of a trusted device for your account, the auth_token and refresh_token are returned immediately.
A device remains trusted for 30 days.
MFA key object
The following table describes the properties of the MFA key object.
Status object
Type object
Errors
The following table lists errors that may occur with this call.