# Is it possible to disallow password-based login for a single user?

**URL:** <https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438>\
**Category:** Get Help\
**Tags:** password, social-connections, login, universal-login\
**Created:** [September 28, 2022, 6:52am UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438 "2022-09-28T06:52:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![abrahamlincolnblockc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abrahamlincolnblockc/32/35038_2.png) [@abrahamlincolnblockc](https://community.auth0.com/u/abrahamlincolnblockc)\
**Post date:** [September 28, 2022, 6:52am UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/1 "2022-09-28T06:52:47Z")

</div>

My app is using email addresses as unique identifiers for users. It also allows users to log in via social connections, i.e. Google Oauth. I want to disable password-based login when a user logs in with Google. Is it possible to somehow configure this in Auth0?

(Note that I want to do this on a per-user basis, rather than globally disable database connections.)

Or, more generally, is there a generalized way to control “which methods of auth should be available for a specific user”?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [September 28, 2022, 1:18pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/2 "2022-09-28T13:18:29Z")

</div>

Hi @abrahamlincolnblockc

This is a complex question and a unique approach.

The more standard approach is “account linking”, so that it doesn’t matter if a user uses their username/password or their social login, they get the same account.

A slightly confusing take is to allow both types of account for the same email address, but they are not linked. They are completely different accounts in spite of having the same identifier. If your backend cannot handle this **you have a security issue - there are account takeover attacks.** This approach is the OOTB approach, if you use Auth0 without any customization.

I think the approach you are taking would be complex and problematic, given the constraints of social accounts (we have no way to block a particular email being used for social, we can only react after it is used).

John

---

<div class="post-metadata">

**Author:** ![abrahamlincolnblockc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abrahamlincolnblockc/32/35038_2.png) [@abrahamlincolnblockc](https://community.auth0.com/u/abrahamlincolnblockc)\
**Post date:** [September 28, 2022, 6:39pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/3 "2022-09-28T18:39:08Z")

</div>

Hi John, thanks for bringing up the account linking issue.

To clarify, by “user” I meant the concept in my own backend, where there’s a one-to-one correspondence between email address and account, regardless of the method of auth. (I want to treat my own datastore as the source of truth, rather than relying on Auth0’s users table.)

I think I’m looking for something similar to [home realm discovery](https://auth0.com/docs/authenticate/login/auth0-universal-login/identifier-first#define-home-realm-discovery-identity-providers). Like, can we do something like:

1. User enters in their email address
2. Auth0 checks to see if there exists an account for that email address + Google Oauth
3. If so, Auth0 directs the user to login with Google Oauth, and doesn’t even allow email + password as an option. (So I guess if I’m not linking accounts, it would in effect prevent the email + password account from being used again in the future.)

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [September 28, 2022, 7:10pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/4 "2022-09-28T19:10:25Z")

</div>

Hi @abrahamlincolnblockc

This is the scenario I was talking about earlier: if you use email as the key, you are susceptible to takeover attacks. In you backend, it is much better to have a unique GUID for user ID instead of email. Then the rest of the problems you are facing become simpler.

John

---

<div class="post-metadata">

**Author:** ![abrahamlincolnblockc](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abrahamlincolnblockc/32/35038_2.png) [@abrahamlincolnblockc](https://community.auth0.com/u/abrahamlincolnblockc)\
**Post date:** [September 28, 2022, 11:14pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/5 "2022-09-28T23:14:21Z")

</div>

What is the mechanism of the takeover attack? Is it not enough to display a message when a user logs in for the first time with Google Oauth into an unverified account that already existed with email + password?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [September 29, 2022, 4:00pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/6 "2022-09-29T16:00:00Z")

</div>

Some variation of this:

Legit User signs in with gmail social.  
Evil hacker registers user with legit user’s gmail address, evil hacker now knows password  
The two accounts are linked, either with Auth0’s linking mechanism or because your backend uses email as a primary key  
Evil hacker now has access to legit user’s account.

That’s a very terse summary, be aware that there are many variations on this. Using email as the key is the red flag for this.

John

---

<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 14, 2024, 10:55pm UTC](https://community.auth0.com/t/is-it-possible-to-disallow-password-based-login-for-a-single-user/91438/7 "2024-11-14T22:55:20Z")

</div>

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