# Lower case user Id in profile or custom registration rule to make sure user\_id is all lower case

**URL:** <https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337>\
**Category:** Get Help\
**Tags:** user-profile\
**Created:** [November 26, 2018, 12:19pm UTC](https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337 "2018-11-26T12:19:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksubramaniam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ksubramaniam/32/5482_2.png) [@ksubramaniam](https://community.auth0.com/u/ksubramaniam)\
**Post date:** [November 26, 2018, 12:19pm UTC](https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337/1 "2018-11-26T12:19:48Z")

</div>

Is there anyway to return a user profile response with following fields in lowercase irrespective of how they’re stored in Auth0 profile:

- sub
- user\_id
- \_id

Further: We already have some users registered with Upper Case characters in their user id filed. In future, is there a way to register the user with all lower case irrespective of how the user entered in the front-end, we’d like to do this inside Auth0?

Note: We’re looking for this because we’re using subject as the user\_id in our domain and our PROD expects all lower case characters, we have some users who’s id in Auth0 is stored with mixed case characters.

Please suggest.

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [November 26, 2018, 10:23pm UTC](https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337/2 "2018-11-26T22:23:10Z")

</div>

I don’t believe there is any way to have Auth0 automatically lowercase those fields for you and there is no way to change the `user_id`.

This is a bit off topic but you might consider using your own UUID instead of Auth0’s `user_id`, and using that in your internal systems. The following rule will add a version 4 UUID to a user, if they don’t have one:

```auto
function (user, context, callback) {
    // Generates a version 4 random UUID. Namespace UUIDs do not appear
    // to be an option in Auth0 at this time.
    const uuid = require('uuid');
    
    user.app_metadata = user.app_metadata || {};
    user.app_metadata.uuid = user.app_metadata.uuid || uuid();
    
    auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
        .then(function(){
            callback(null, user, context);
        })
        .catch(function(err){
            callback(err);
        });
}

```

---

<div class="post-metadata">

**Author:** ![ksubramaniam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ksubramaniam/32/5482_2.png) [@ksubramaniam](https://community.auth0.com/u/ksubramaniam)\
**Post date:** [December 5, 2018, 10:02am UTC](https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337/3 "2018-12-05T10:02:53Z")

</div>

Thanks Mark.

We ended up changing our application to take care of this. Further, we updated the JS to send all lower case before submitting the registration form.

---

<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:** [January 4, 2019, 10:02am UTC](https://community.auth0.com/t/lower-case-user-id-in-profile-or-custom-registration-rule-to-make-sure-user-id-is-all-lower-case/18337/4 "2019-01-04T10:02:53Z")

</div>

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