How to automatically configure a newly created (sign up) user

Let’s say I would like to automatically add a certain role or setup something on a particular user at the moment they are created within Auth0.

I understand that the place to perform this logic would be within a Post User Registration Hook , correct ?

If so, how we would do the same but for scenarios using Social or Enterprise connections, it seems these are not supported?

Thanks in advance.

Hi @gerardo.zenobi,

If you want to add some data to a user’s auth0 profile on first login, and have it happens regardless of connection type (social vs db vs enterprise), you will have to do so in a rule. Typically customers will check for a first login flag, or some data that you would’ve added on first login, and add it then.

This thread details the difference between using a rule vs a hook.

There is a caveat when using rules vs hooks; if you create a user with the signup endpoint or through the dashboard/management API, they will not get the data until their first login. If this is an issue there are strategies to cover that case too. Let me know and we can discuss them.

Thanks,
Dan

Thanks for the rapid reply @dan.woda !

To summarise then:
For this requirement, one off user setup/configuration, Hooks would not work neither for social nor enterprise connections. Instead Rules upon first login would have to be used. Correct?

Lastly, is there a plan for Hooks to support social/enterprise connections in the future?

Thanks.

Gerardo.

You are correct. I have heard it mentioned, but it is not on our roadmap at the moment. If you would like to give us some feedback on your use-case we would greatly appreciate it!

1 Like

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