Two-Factor setup.
Two-factor setup can be used in three cases:
- Initial login and application requires 2FA
- An authenticated user wishing to change their 2FA configuration
- An authenticated user wishes to enable or disable 2FA (assuming SECURITY_TWO_FACTOR_REQUIRED is False). Allowed 2FA methods are controlled via the configuration SECURITY_TWO_FACTOR_ENABLED_METHODS. This endpoint is protected by a 'freshness' check - meaning the caller will be required to have authenticated recently. In addition, to ensure correctness, the newly setup method must be verified by sending and entering a code prior to it being permanently stored.
post/tf-setup
Request body
Example request
{
"setup": "sms",
"phone": "650-555-1212"
}Response
Two-Factor setup response. Please note that the newly setup method must be validated PRIOR to it being stored permanently.
Example response
{
"meta": {
"code": 200
},
"response": {
"tf_state": "validating_profile",
"tf_primary_method": "sms",
"tf_method": "sms"
}
}