# MFA Challenge 'server\_error' 'Unauthorized'

**URL:** <https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199>\
**Category:** Get Help\
**Tags:** token, mfa-sms, auth0, mfa\
**Created:** [March 3, 2022, 10:47am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199 "2022-03-03T10:47:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cam71101](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cam71101/32/33194_2.png) [@cam71101](https://community.auth0.com/u/cam71101)\
**Post date:** [March 3, 2022, 10:47am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/1 "2022-03-03T10:47:27Z")

</div>

I have been trying to implement a custom MFA workflow in Auth0 using the details described on this page: [https://auth0.com/docs/mfa/authenticate-with-ropg-and-mfa/enroll-challenge-sms-voice-authenticators 5](https://auth0.com/docs/mfa/authenticate-with-ropg-and-mfa/enroll-challenge-sms-voice-authenticators)

I have successfully enrolled a user for MFA this way.

However, when it comes to the user disabling MFA I’ve run into some issues.

The API attempts to fetch a token and receives a response similar to this:

```auto
{

"error": "mfa_required",

"error_description":

"Multifactor authentication required",

"mfa_token": "Fe26...Ha"

}

```

The API then fetches the enrolled authenticators and gets a similar response similar to this:

```auto
[

{

id: 'sms|dev_gH5vQnpT4ijbPLz5',

authenticator_type: 'oob',

active: true,

oob_channel: 'sms',

name: 'XXXXXXXX5635'

},

]

```

The API then takes the correct ID and the mfa\_token from above and requests a challenge as described here: https://auth0.com/docs/secure/multi-factor-authentication/authenticate-using-ropg-flow-with-mfa/enroll-challenge-sms-voice-authenticators.

We’re using these request options:

```auto
{

method: 'POST',

url: `https://${config.auth0.domain}/mfa/challenge`,

data: {

client_id: config.auth0.clientId,

client_secret: config.auth0.clientSecret,

challenge_type: 'oob',

authenticator_id: id,

mfa_token: "Fe26...Ha"

}

};

```

Someone suggested in this thread https://community.auth0.com/t/post-request-to-mfa-challenge-endpoint-returns-unauthorized-error/48577, to add **'Content-Type: application/json’** to the headers, which we are also doing.

We get this error:

```auto
{

"error":"server_error",

"error_description":"Unauthorized"

}

```

Can anyone help?

---

<div class="post-metadata">

**Author:** ![cam71101](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cam71101/32/33194_2.png) [@cam71101](https://community.auth0.com/u/cam71101)\
**Post date:** [March 4, 2022, 9:55am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/2 "2022-03-04T09:55:42Z")

</div>

Would be great if someone could help!

---

<div class="post-metadata">

**Author:** ![cam71101](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cam71101/32/33194_2.png) [@cam71101](https://community.auth0.com/u/cam71101)\
**Post date:** [March 8, 2022, 10:49am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/3 "2022-03-08T10:49:42Z")

</div>

Can anyone help out?

---

<div class="post-metadata">

**Author:** ![cam71101](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cam71101/32/33194_2.png) [@cam71101](https://community.auth0.com/u/cam71101)\
**Post date:** [March 10, 2022, 2:11pm UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/4 "2022-03-10T14:11:57Z")

</div>

Would be good if someone could help

---

<div class="post-metadata">

**Author:** ![cam71101](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cam71101/32/33194_2.png) [@cam71101](https://community.auth0.com/u/cam71101)\
**Post date:** [March 14, 2022, 3:41pm UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/5 "2022-03-14T15:41:30Z")

</div>

We’re still struggling with this.

---

<div class="post-metadata">

**Author:** ![dikoga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dikoga/32/14898_2.png) [@dikoga](https://community.auth0.com/u/dikoga)\
**Post date:** [August 17, 2022, 2:22am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/6 "2022-08-17T02:22:20Z")

</div>

I was receiving this error and the header did the trick

```auto
  curl --request POST \
  --url 'https://domain/mfa/challenge' \
  --header 'content-type: application/json' \
  --data '{ "client_id": "client_id", "client_secret": "client_secret", "challenge_type": "oob", "authenticator_id": "sms|id", "mfa_token": "mfa_token" }'

```

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 4, 2022, 2:06pm UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/7 "2022-11-04T14:06:39Z")

</div>

Thank you for sharing this with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 22, 2022, 9:28am UTC](https://community.auth0.com/t/mfa-challenge-server-error-unauthorized/79199/8 "2022-12-22T09:28:20Z")

</div>


