# How to disable sign up via social login?

**URL:** <https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843>\
**Category:** Get Help\
**Tags:** social, auth0\
**Created:** [January 25, 2020, 10:42pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843 "2020-01-25T22:42:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vacilando](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vacilando/32/18696_2.png) [@vacilando](https://community.auth0.com/u/vacilando)\
**Post date:** [January 25, 2020, 10:42pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/1 "2020-01-25T22:42:28Z")

</div>

For name+password users I disabled sign ups ( Disable Sign Ups is now ON).

However, when users choose a social login (Google in our case) they are able to create accounts and log in!  
How to make sure social login users cannot become users unless they are created by an admin?

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 26, 2020, 12:05am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/2 "2020-01-26T00:05:46Z")

</div>

Hi @vacilando, welcome to the community!

There’s no way of stopping signup of social logins, because conceptually the signup does not happen at Auth0, but at the external identity provider. Under the same premise, an administrator can’t create a social login user at Auth0 directly.  
What you might be after is, instead, some kind of authorization control. I.e. when you say “Authenticate with Google” the user will be able to do so (they already have their Google account!), but then you can say “O.K. John Doe, you are not allowed into this application”.  
This authorization will involve checking some kind of identifier (most likely the email address) of the user that just logged in against a list of “approved users” (this can be in any database). This authorization policy can be in two different places:

- At an Auth0 rule, where you can flat out deny authorization based on this condition. The application that requested the authentication will instead receive an error (that will need to present to the user somehow, explaining the situation).

- Directly at the application, after receiving the authentication result from Auth0 (in this case, from the Auth0 perspective, it will look as a regular login).

---

<div class="post-metadata">

**Author:** ![vacilando](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vacilando/32/18696_2.png) [@vacilando](https://community.auth0.com/u/vacilando)\
**Post date:** [January 27, 2020, 10:26pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/3 "2020-01-27T22:26:59Z")

</div>

Hi @nicolas_sabena - thanks for the clear answer. Two follow-up questions.

1. Is this as clearly or even better explained in the online documentation and if not, could it be added.
2. My use case is simple: I have an e-mail address corresponding to a name/password account in auth0, and if somebody comes in via social login only that e-mail address may go through. Is there a snippet for Rules that you can share that allows just that? It’s a very simple use case that many users will benefit from.

Thanks!

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 28, 2020, 12:05am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/4 "2020-01-28T00:05:47Z")

</div>

> [@vacilando](#):
>
> Is this as clearly or even better explained in the online documentation and if not, could it be added.

I’m not sure. I’m curious if you can think of any of the documents you went through while researching this that would be a good place to clarify it.

> My use case is simple: I have an e-mail address corresponding to a name/password account in auth0, and if somebody comes in via social login only that e-mail address may go through. Is there a snippet for Rules that you can share that allows just that? It’s a very simple use case that many users will benefit from.

Where would you have this list of users that _can_ login with a social identity? In an external database?

---

<div class="post-metadata">

**Author:** ![vacilando](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vacilando/32/18696_2.png) [@vacilando](https://community.auth0.com/u/vacilando)\
**Post date:** [January 28, 2020, 8:00am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/5 "2020-01-28T08:00:09Z")

</div>

@nicolas_sabena:

I see a number of posts in Community, with various answers, e.g.

- [Disable Social Signup..except for Linking existing account](http://community.auth0.com/t/disable-social-signup-except-for-linking-existing-account/19761)
- [Is there a difference between login & signup for social? - #4 by assaf.shlomi](http://community.auth0.com/t/is-there-a-difference-between-login-signup-for-social/15038/4)  
I am sure you can find more as you know the space far better.

Linking of accounts seems to exist as well. albeit with separate accounts (there go the stats) and a very complicated setup.

- [https://auth0.com/docs/link-accounts](https://auth0.com/docs/link-accounts)

For cases like ours, where social login should be allowed for the ease of the login process but only for previously registered users, it should be enough that a stranger clicks on social login button and gets an error _unless_ an admin had created an username/password account on beforehand with the same e-mail address. Where do I have this list of users - in Auth0 database, that is in [https://manage.auth0.com/dashboard/eu/vacilando/users](https://manage.auth0.com/dashboard/eu/vacilando/users)

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 28, 2020, 9:39pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/6 "2020-01-28T21:39:22Z")

</div>

> Linking of accounts seems to exist as well. albeit with separate accounts (there go the stats) and a very complicated setup.  
> For cases like ours, where social login should be allowed for the ease of the login process but only for previously registered users, it should be enough that a stranger clicks on social login button and gets an error _unless_ an admin had created an username/password account on beforehand with the same e-mail address. Where do I have this list of users - in Auth0 database, that is in [https://manage.auth0.com/dashboard/eu/vacilando/users](https://manage.auth0.com/dashboard/eu/vacilando/users)

The concept of creating the users in advance for social connection does not exist in Auth0 as of now.

You can create database users in advance, but they would still be completely separate entities from social logins, even if the email match, so you would need to create a rule to handle the additional logic.

The strategy then could be:

- Create database users in advance (no public signup allowed)
- Add a rule that checks if the user logging in is a social connection user. If so:
  - If this user is already linked to a db user, allow the log in normally.
  - Check if there’s a user with the same (and verified) email address in the DB connection (you can use API v2’s search-by-email endpoint for this).
  - If found, link the identities making the db connection user the primary identity
  - If not found, deny authorization

---

<div class="post-metadata">

**Author:** ![niclas.karlin](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/niclas.karlin/32/22085_2.png) [@niclas.karlin](https://community.auth0.com/u/niclas.karlin)\
**Post date:** [June 22, 2020, 6:41am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/7 "2020-06-22T06:41:07Z")

</div>

Creating users manually and then letting them use social login sounds like what I would like to do. Do you have a rule to share with me?  
How does this idea relate to these:

> **[Auth0 Actions](https://auth0.com/docs/customize/actions)**
>
> Describes Auth0 Actions, which are secure, tenant-specific, self-contained functions that allow you to customize the behavior of Auth0.

> **[Account Link Extension](https://auth0.com/docs/customize/extensions/account-link-extension)**
>
> Learn about the Account Link extension, which allows users with two accounts with the same email to be prompted to link them.

Also, I get this error when running Account link:

` **invalid_request** : Invalid parameter: client_id must be a string`

---

<div class="post-metadata">

**Author:** ![lewis.chapman](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@lewis.chapman](https://community.auth0.com/u/lewis.chapman)\
**Post date:** [November 1, 2021, 8:56am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/8 "2021-11-01T08:56:49Z")

</div>

Any progress on this one?

We are experiencing this same Linking error.

---

<div class="post-metadata">

**Author:** ![dang.gffg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dang.gffg/32/52357_2.png) [@dang.gffg](https://community.auth0.com/u/dang.gffg)\
**Post date:** [November 11, 2023, 7:10pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/9 "2023-11-11T19:10:27Z")

</div>

> Creating users manually and then letting them use social login sounds like what I would like to do

I’m looking for solution too. I think almost all private admin panel and internal apps want to implement auth this way.

---

<div class="post-metadata">

**Author:** ![jon11](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jon11/32/54313_2.png) [@jon11](https://community.auth0.com/u/jon11)\
**Post date:** [January 26, 2024, 7:39pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/10 "2024-01-26T19:39:03Z")

</div>

Any update on this? Would like to do the same - manually add users to my app and only then can they log in with their Google account.

---

<div class="post-metadata">

**Author:** ![lijunle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lijunle/32/57022_2.png) [@lijunle](https://community.auth0.com/u/lijunle)\
**Post date:** [May 11, 2024, 8:45am UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/11 "2024-05-11T08:45:53Z")

</div>

I can see the admin is able to block a SSO user. Could we have all SSO login blocked by default, until admin approve/unblock it, or link it to an existing DB user?

> **[Block and Unblock Users](https://auth0.com/docs/manage-users/user-accounts/block-and-unblock-users#unblock-a-user-who-was-automatically-blocked)**
>
> Describes how to block and unblock users.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/5/5/55128ef03e449a65cd22fa28c56963f5cca9af7e.png)

* * *

Edit: I archived by defining a customer field `user_metadata.allowed`. New user will not have this metadata field denied, so they are denied. The admin needs to manually set `allow:true` to accept this user.

Configure Login flow with following code:

```js
exports.onExecutePostLogin = async (event, api) => {
  if (!event.user.user_metadata.allowed) {
    api.access.deny("User metadata allowed is not set");
  }
};

```

Set `allowed:true` on an existing user.

![image](https://global.discourse-cdn.com/auth0/original/3X/5/f/5fd318c98b97472629747ae41b8795072cd95357.png)

* * *

I saw a more comprehensive script here:

> [@Disable Social Signup..except for Linking existing account](https://community.auth0.com/t/disable-social-signup-except-for-linking-existing-account/19761/5):
>
> Hello, I had the same issue and wanted in my app the same control. An admin should first create a user in the database password connection. Then only users can login via social login. The rule will prvent login in with a social account if their primary db account is not set up: function disableSocialSignups(user, context, callback) { // initialize app\_metadata user.app\_metadata = user.app\_metadata || {}; // Detect if this is the primary login/password connection const isPrimaryDbConnect…

---

<div class="post-metadata">

**Author:** ![abaumgartner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/abaumgartner/32/59099_2.png) [@abaumgartner](https://community.auth0.com/u/abaumgartner)\
**Post date:** [August 8, 2024, 9:52pm UTC](https://community.auth0.com/t/how-to-disable-sign-up-via-social-login/36843/12 "2024-08-08T21:52:27Z")

</div>

Any update on this? We would also like this feature. It seems like a very common use case for internal apps.
