# Adding user via dashboard does not set preferred\_username

**URL:** <https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549>\
**Category:** Get Help\
**Created:** [February 6, 2020, 3:38pm UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549 "2020-02-06T15:38:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon.turvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simon.turvey/32/18994_2.png) [@simon.turvey](https://community.auth0.com/u/simon.turvey)\
**Post date:** [February 6, 2020, 3:38pm UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/1 "2020-02-06T15:38:23Z")

</div>

Hi,

In a new tenant, I have configured an Username-Password-Authentication connection with “Requires Username” and “Disable Sign Ups” set. I have an application configured with “OIDC Conformant” set.

When I manually add a user through the dashboard and configure their username this appears in the raw JSON view as `username`. When I get user profile details via `getUser` or `getIdTokenClaims` from the auth0-spa-js SDK I am expecting to see the OIDC `preferred_username` field supplied as part of the standard claim set. I do not. I don’t see either `username` or `preferred_username`.

Any assistance much appreciated!

Simon

---

<div class="post-metadata">

**Author:** ![simon.turvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simon.turvey/32/18994_2.png) [@simon.turvey](https://community.auth0.com/u/simon.turvey)\
**Post date:** [February 11, 2020, 7:17am UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/2 "2020-02-11T07:17:59Z")

</div>

I must have asked something either dumb or truly exotic! Almost every question bar mine someone has managed to weigh in on with a response. Hope someone can provide some pointers!

---

<div class="post-metadata">

**Author:** ![tanver.hasan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tanver.hasan/32/40750_2.png) [@tanver.hasan](https://community.auth0.com/u/tanver.hasan)\
**Post date:** [February 19, 2020, 12:04pm UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/3 "2020-02-19T12:04:57Z")

</div>

It seems like **prefered\_username** claim is not present in the token. As a workaround, you can try using Rule to map the **username** property to **prefered\_username** claim.

```auto
function (user, context, callback) {

  user.preferred_username = user.username;
  return callback(null, user, context);
}

```

---

<div class="post-metadata">

**Author:** ![simon.turvey](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simon.turvey/32/18994_2.png) [@simon.turvey](https://community.auth0.com/u/simon.turvey)\
**Post date:** [February 25, 2020, 9:12am UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/4 "2020-02-25T09:12:16Z")

</div>

This worked a treat, thanks. As the preferred\_username claim is part of the standard OIDC set there’s no need to request it specifically in the scope - which is nice.

As a feature request, I’d suggest considering adding this mapping automatically. I can’t think of any strong reasons why this shouldn’t be the case for people opting in to OIDC compliant flows.

---

<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:** [February 25, 2020, 9:30am UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/5 "2020-02-25T09:30:02Z")

</div>

Great to hear that! We’ll file that as a feature request to our product team.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 11, 2020, 9:30am UTC](https://community.auth0.com/t/adding-user-via-dashboard-does-not-set-preferred-username/37549/6 "2020-03-11T09:30:08Z")

</div>

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