# Pre-assigning roles to social accounts

**URL:** <https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027>\
**Category:** Get Help\
**Tags:** google, oauth2, auth0\
**Created:** [February 17, 2021, 4:31pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027 "2021-02-17T16:31:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dallagi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dallagi/32/27665_2.png) [@dallagi](https://community.auth0.com/u/dallagi)\
**Post date:** [February 17, 2021, 4:31pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/1 "2021-02-17T16:31:15Z")

</div>

Hi,

We’d like to assign roles and permissions to users connecting via social login (Google) based on their email address.  
The reason is that we’re switching users from our existing internal auth system (based on Google OAuth) to Auth0, and we’d like to preserve their roles at their first login.

Our current idea is to create “placeholder” passwordless users with the correct roles and to link them to the OAuth google accounts on the first signin. Is this doable (and advisable) with a custom rule?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 18, 2021, 5:27pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/3 "2021-02-18T17:27:57Z")

</div>

Hi @dallagi,

Welcome to the Community!

I will have to research this approach. I will let you know what I find!

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 18, 2021, 7:29pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/4 "2021-02-18T19:29:00Z")

</div>

Hi @dallagi,

After a bit of research, I believe your strategy of creating passwordless users, assigning roles and then linking accounts will work for this. However, instead of writing a custom rule to link accounts, it’s recommended to use the [Account Link Extension](https://auth0.com/docs/extensions/account-link-extension?_ga=2.185793130.239155659.1613392532-1595415333.1607347674) which is more secure than linking accounts automatically.

Here is some additional documentation around account linking: [User Account Linking](https://auth0.com/docs/users/user-account-linking)

---

<div class="post-metadata">

**Author:** ![dallagi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dallagi/32/27665_2.png) [@dallagi](https://community.auth0.com/u/dallagi)\
**Post date:** [February 22, 2021, 6:44pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/5 "2021-02-22T18:44:12Z")

</div>

Hi @stephanie.chamblee , thanks a lot for your reply!

As a followup question, is it possible to create passwordless users from the auth0 UI?  
I’ve been successful at creating them using the API, but if I try from the UI I only see the possibility to create database (ie. with password) users.

Thanks a lot again

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [February 22, 2021, 7:11pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/6 "2021-02-22T19:11:14Z")

</div>

Hi @dallagi,

No problem, I am happy to help!

Unfortunately, you can only create database users in the dashboard UI, not passwordless users. You will need to use the Management API to create them.

If this is a feature you’d like to see Auth0 support, I’d encourage you to create a topic in our new Feedback category. Members of the community can vote on the features they’d most like to see implemented. The category is reviewed by the product team.

> **[Feedback](https://community.auth0.com/c/feedback/95)**
>
> Submit and vote on product feedback and feature requests.

---

<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 9, 2021, 7:11pm UTC](https://community.auth0.com/t/pre-assigning-roles-to-social-accounts/58027/7 "2021-03-09T19:11:29Z")

</div>

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