DEV Community

evoq
evoq

Posted on

Auth0: How to add custom properties to UserObject?

Hello dear community,
i don't know much about Auth0 and need help. And I wonder how to add my own properties when creating a user. just for info i have connected Auth0 to my own MongoDB atlas database.

i want to add a customId when creating a user, and this should be a 16-digit random number.

And my userObj should then look something like this:

{
_id: ObjectId("5f720126054c87001662a138"),
connection:"MongoDB"
client_id:"zoClZ3gZE56iwblHXQ1vgwEcLfYr81Bx"
email:"gustek@gustek.com"
username:"gustek"
password:"$2b$10$dE69gGsDqVfWtmnXZ6EaKetILU"
tenant:"dev-test"
email_verified:false
!!!customId:"9829539769841530"!!!
}

I mean I found something in the documentation but I do not know how to implement it:
https://auth0.com/docs/users/set-metadata-properties-on-creation

Do I have to do it over this surface?

Surface

As I said before, I have no idea how I could achieve this. I am grateful for every answer!

Top comments (0)