# Authorization Extension - right way to auto-assign a role to a user upon signup \*or\* import

**URL:** <https://community.auth0.com/t/authorization-extension-right-way-to-auto-assign-a-role-to-a-user-upon-signup-or-import/8338>\
**Category:** Get Help\
**Tags:** authorization-extens, signup, user-import\
**Created:** [September 29, 2017, 3:14am UTC](https://community.auth0.com/t/authorization-extension-right-way-to-auto-assign-a-role-to-a-user-upon-signup-or-import/8338 "2017-09-29T03:14:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Tillotson](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/joe_tillotson/32/12709_2.png) [@Joe\_Tillotson](https://community.auth0.com/u/Joe_Tillotson)\
**Post date:** [September 29, 2017, 3:14am UTC](https://community.auth0.com/t/authorization-extension-right-way-to-auto-assign-a-role-to-a-user-upon-signup-or-import/8338/1 "2017-09-29T03:14:43Z")

</div>

What is the best/most-proper way to auto-assign a role (an already defined role) to a new user _either_ when they signup, _or_ when they are imported upon first login?

1. Custom rule? it seems cheesy to have a rule that only applies to a new user signup / import, because this rule will be executed every time the user authenticates or renews their access token → 1000’s of times for an ‘event’ that only occurs once. Also, within a rule, how do you know it’s the first time the user has authenticated unless you do something (again, cheesy) like make a flag property on the user’s profile.
2. Web-hook instead of a rule? 2a-Web Hooks still say _beta_, should we use them in a production environment? 2b-Will the (web hook) pre-registration event occur for import as well as for a ‘true signup’? 2c-Can I know the client in a web hook? I see how to know what DB connection it is, but in this case, I only want to assign the (default) role to the new user if/when they are signing in or logging in for the first time via a specific client. IOW, I don’t want every user for a given connection to get the role.

Regarding 2c. the official documentation for web-hooks says: “For example, the client object comes with the following parameters: client name, client ID…”, but per the parameters detail documentation, only the connection & user data is available, not the client initiating the new user.

---

<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 2, 2018, 5:56am UTC](https://community.auth0.com/t/authorization-extension-right-way-to-auto-assign-a-role-to-a-user-upon-signup-or-import/8338/2 "2018-03-02T05:56:44Z")

</div>


