# mobilePhone not being returned in oktaAuth.getUser

**URL:** <https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688>\
**Category:** Questions\
**Created:** [June 11, 2021, 11:01pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688 "2021-06-11T23:01:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![msch92](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/msch92/32/2519_2.png) [@msch92](https://devforum.okta.com/u/msch92)\
**Post date:** [June 11, 2021, 11:01pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/1 "2021-06-11T23:01:19Z")

</div>

Hello,

I’m currently instantiating an oktaAuth as follows:

```auto
const oktaAuth = new OktaAuth({
  issuer: `https://dev-xxx.okta.com/oauth2/default`,
  clientId: 'xxx',
  scopes: ['openid', 'profile', 'email', 'phone'],
  restoreOriginalUri: async () => {
    window.location.href = window.location.origin + DASHBOARD;
  }
})

```

For signup, the self registration form has a non-required mobile phone field. During testing, I entered a number in this field and it’s showing up on the okta user profile, however, for the logged in user, when trying the following:

```auto
oktaAuth.getUser().then((res) => console.log(res))

```

phone\_number does not show up (other fields such as email and name do).

---

<div class="post-metadata">

**Author:** ![okra-okta](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/okra-okta/32/2838_2.png) [@okra-okta](https://devforum.okta.com/u/okra-okta)\
**Post date:** [June 15, 2021, 4:29pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/2 "2021-06-15T16:29:44Z")

</div>

In your self service registration configuration, did you use `primaryPhone` for the field or did you add a custom attribute?

---

<div class="post-metadata">

**Author:** ![msch92](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/msch92/32/2519_2.png) [@msch92](https://devforum.okta.com/u/msch92)\
**Post date:** [June 16, 2021, 5:06pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/3 "2021-06-16T17:06:24Z")

</div>

@okra-okta I’m using the mobilePhone field as follows:

 ![Screen Shot 2021-06-16 at 10.05.53 AM](https://global.discourse-cdn.com/oktadev/original/2X/e/e7bb01b7dfca7783909f7d955e49b4a907846424.png)

---

<div class="post-metadata">

**Author:** ![msch92](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/msch92/32/2519_2.png) [@msch92](https://devforum.okta.com/u/msch92)\
**Post date:** [June 16, 2021, 5:06pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/4 "2021-06-16T17:06:46Z")

</div>

I think I tried with primaryPhone as well, and the same issue happened. but we want to use mobilePhone if possible

---

<div class="post-metadata">

**Author:** ![okra-okta](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/okra-okta/32/2838_2.png) [@okra-okta](https://devforum.okta.com/u/okra-okta)\
**Post date:** [June 17, 2021, 4:15pm UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/5 "2021-06-17T16:15:52Z")

</div>

Can you check if either of those user profile attributes are mapped to the `phone_number` attribute on the app user profile?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 10, 2024, 12:32am UTC](https://devforum.okta.com/t/mobilephone-not-being-returned-in-oktaauth-getuser/14688/6 "2024-02-10T00:32:46Z")

</div>


