Auth0 Home Blog Docs

Can user.nickname be changed with RESTAPI POST or PATCH?

auth0
api
management-api

#1

Hello,

I have a couple of questions. First, we are doing a React Native app, and Auth0 is handling the user log-in & JWT Token Authentication. Here is an example of the user object that is returned for a user —

Object {email_verified: true, email: "faddah@blahblahblah.com", updated_at: "2018-07-26T19:20:28.314Z", name: "faddah@thecyrkus.com", picture: "https://s.gravatar.com/avatar/34cf73950c54a00c5a85…&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Ffa.png"…}
created_at: "2018-02-26T19:39:28.194Z"
email: "faddah@blahblahblah.com"
email_verified: true
identities: Array(1)
last_ip: "209.201.125.91"
last_login: "2018-07-26T19:20:28.314Z"
last_password_reset: "2018-03-20T18:19:24.954Z"
logins_count: 1615
name: "faddah@blahblahblah.com"
nickname: "faddah"
picture: "https://s.gravatar.com/avatar/34cf73950c54a00c5a85b444e16d7c15?s=480&r=pg&d=https%3A%2F%2Fcdn.auth0.com%2Favatars%2Ffa.png"
updated_at: "2018-07-26T19:20:28.314Z"
user_id: "auth0|XXXXXXXXXXXXXXXXXXXXXXXX"
user_metadata: Object
state: "OR"
type: "interested"
__proto__: Object
__proto__: Object

My questions are:

  • Why are both the user.name field and the user.email identical in value (both are the user’s email)? Isn’t this unnecessarily redundant?
  • Why is there both a user.name and a user.nickname field? should those both just be, user.name, with it being used to give the user name monicker by which the user would like be known on the site?
  • Finally, and most importantly, is there a way to update the user.nickname field to your Auth0 backend if the user wishes to be known by another Nickname/Log-in name on our site?

I’ve searched your API Docs, and while I’ve found API documentation to update the user.password in the user object in the Auth0 backend, I don’t see anything to indicate how to go about updating the user.nickname.

Is there any documentation on this, somewhere I am not seeing? Any help with this would be appreciated. Also, if this is not available through your API, is there a place I could go, please, to make such a feature request? Please advise.

Thank you in advance for your help.

best,

— faddah


#3

user.name will be set to the email address if Auth0 can’t find given and family names anywhere else. If you are using a 3rd party for authentication like google or AD, Auth0 will try to parse given and family names from that source. Unfortunately, at this time there is no way to change user.name, user.given_name, etc.

nickname is set to the local part of the email address, unless you have usernames enabled in a connection, in which case nickname is set to the username. I don’t know what the purpose of nickname is.

Many of the top-level attributes in a user’s profile are puzzling, IMO. As much as possible I try to ignore the top-level attributes and “do my own thing” in app_metadata and user_metadata.