# Can't get mfa\_token from react-native-auth0 SDK

**URL:** <https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677>\
**Category:** Get Help\
**Tags:** react-native, auth0, login\
**Created:** [July 26, 2022, 4:04pm UTC](https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677 "2022-07-26T16:04:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alberto.ivan92](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alberto.ivan92/32/38982_2.png) [@alberto.ivan92](https://community.auth0.com/u/alberto.ivan92)\
**Post date:** [July 26, 2022, 4:04pm UTC](https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677/1 "2022-07-26T16:04:06Z")

</div>

Please include the following information in your post:

- Which SDK this is regarding:  
react-native-auth0
- SDK Version: 2.13.3
- Platform Version: react-native: “0.67.1”,

Hello people, I am trying to get the mfa\_token from the below method:

```auto
export async function login(email, password) {
  const response = await auth0.auth.passwordRealm({
    username: email,
    password: password,
    realm: 'Username-Password-Authentication',
  });
  return response.accessToken;

```

the problem is that I don’t t get the mfa access token from the catch response, I am only getting this message: [mfa\_required: Multifactor authentication required]. without the mfa access token.

 ![Screen Shot 2022-07-26 at 11.03.10](https://global.discourse-cdn.com/auth0/original/3X/8/d/8d9c2f5efe27dd7cf9097ef4279b9562a0b9c9dc.png)

I already granted MFA permission to my app, and I was able to get the MFA token by calling directly the API by postman:

 ![Screen Shot 2022-07-26 at 11.16.32](https://global.discourse-cdn.com/auth0/original/3X/1/a/1ae9a5245d45da909c97bd839ad4263645efff2e.jpeg)

but from the React Native Auth0 SDK using passwordRealm function I am not able.

Does anyone knows what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![alberto.ivan92](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alberto.ivan92/32/38982_2.png) [@alberto.ivan92](https://community.auth0.com/u/alberto.ivan92)\
**Post date:** [July 26, 2022, 5:26pm UTC](https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677/3 "2022-07-26T17:26:50Z")

</div>

Solution:  
In my Catch error I should concatenate the json string in order to display the mfa token, like in the example below:  
.catch(error =\> console.log(error.json));

before I had it like this:  
.catch(error =\> console.log(error));

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 26, 2022, 5:29pm UTC](https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677/4 "2022-07-26T17:29:59Z")

</div>

Awesome, thanks for the update and solution @alberto.ivan92 - Also, welcome to the community! 😄

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 10, 2022, 5:30pm UTC](https://community.auth0.com/t/cant-get-mfa-token-from-react-native-auth0-sdk/87677/5 "2022-08-10T17:30:30Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
