# Separating user login option by their email domain

**URL:** <https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [October 4, 2018, 1:42am UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300 "2018-10-04T01:42:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shay.k](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shay.k/32/9138_2.png) [@shay.k](https://community.auth0.com/u/shay.k)\
**Post date:** [October 4, 2018, 1:42am UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300/1 "2018-10-04T01:42:48Z")

</div>

Hi,

What is the best way to handle the following scenario:  
I have both my clients and my employees login to my product, but I want to enforce separate security rules on them.  
I want my employees (all with emails of @mydomain.com) to be able to ONLY login with gsuite SSO, and my clients (all with emails NOT @mydomain.com) to only be able to login with a generated user and password I’ve provided.  
The user name is always the email address so it’s easy to recognize if a user is my employee or a client.

I don’t really care UI-wise if both sets of users will see both login options (i.e. Google login button AND user name and password fields).  
All I care is to be able to enforce the security of gsuite on my employees (i.e. 2step-auth, password length, etc.) and provide them with SSO, and at the same time no security restrictions for my clients.

The simplest solution is NOT to tell my employees their user and password, thus forcing them to use Google login button, BUT then they can click the “forgot password” and bypass this obstacle easily.

Thanks,

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [October 5, 2018, 7:28pm UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300/3 "2018-10-05T19:28:44Z")

</div>

Hey there @shay.k and let you know that I am looking into your described situation. Thanks!

---

<div class="post-metadata">

**Author:** ![James.Morrison](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/james.morrison/32/13507_2.png) [@James.Morrison](https://community.auth0.com/u/James.Morrison)\
**Post date:** [October 9, 2018, 10:01pm UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300/4 "2018-10-09T22:01:46Z")

</div>

Reviewing the use case you described appears to be related to a Enterprise feature as described [here](https://auth0.com/docs/libraries/lock/v11/selecting-the-connection-for-multiple-logins#option-2-using-email-domains-with-lock) within lock. Please let me know if this is the desired result. Thanks!

---

<div class="post-metadata">

**Author:** ![shay.k](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/shay.k/32/9138_2.png) [@shay.k](https://community.auth0.com/u/shay.k)\
**Post date:** [October 10, 2018, 1:41pm UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300/5 "2018-10-10T13:41:21Z")

</div>

Hi @James.Morrison looks like this is spot on!  
I’ll try it.

---

<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:** [November 9, 2018, 1:41pm UTC](https://community.auth0.com/t/separating-user-login-option-by-their-email-domain/16300/6 "2018-11-09T13:41:23Z")

</div>

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