I am trying to add a new email to the list of authenticators (Associating Authenticator) but I am getting the following error,
{
“error”: “invalid_request”,
“error_description”: “email is required for email channel”,
“error_uri”: 400
}
I am hitting the endpoint /mfa/associate to associate a new email as an authenticator. In the body I am passing the following JSON object where I am passing a new email.
{
“authenticator_types”:[“oob”],
“oob_channels”:[“email”],
“email”: “testauth0777@gmail.com”
}
The username for the account is abhayathapa@adt.com but I am trying add a new email authenticator and it is erroring out and saying that there is no email in the body when there is one
Hi @abhayathapa,
Thanks for reaching out to the Auth0 Community!
I understand you are having issues enrolling the Email MFA Factor when calling the /mfa/associate endpoint.
After looking at the body of your request, everything appears to be correct.
I have just tested this myself and could reproduce the issue only if I did not pass the email parameter in the request.
I was able to get it to work by making the following request:
curl --request POST \
--url 'https://YOUR_DOMAIN/mfa/associate' \
--header 'authorization: Bearer {mfaToken}' \
--header 'content-type: application/json' \
--data '{ "authenticator_types": ["oob"], "oob_channels": ["email"], "email": "testuser@example.com" }'
Reference:
Please let me know how this works for you.
Thanks,
Rueben