# Limiting Social Signups

**URL:** <https://community.auth0.com/t/limiting-social-signups/50961>\
**Category:** Get Help\
**Tags:** rules, social-connections\
**Created:** [October 5, 2020, 3:21am UTC](https://community.auth0.com/t/limiting-social-signups/50961 "2020-10-05T03:21:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![diego.torres](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/diego.torres/32/13443_2.png) [@diego.torres](https://community.auth0.com/u/diego.torres)\
**Post date:** [October 5, 2020, 3:21am UTC](https://community.auth0.com/t/limiting-social-signups/50961/1 "2020-10-05T03:21:59Z")

</div>

I have enabled Google Social Connection for my Regular Web Application.  
I need to allow only some specific email domains from signing in so I have added a rule that checks and throws an UnauthorizedError if the domain is not valid.  
The problem I have is that an user gets created no matter what, even when the validation fails and throws. At least they don’t get authorization but my questions are:

- Is there any way to prevent this unwanted user from being registered in the first place?
- Does this failed authorization attempt count towards my monthly limit of “External Active Users”?
  - If it does count, how can I protect my Auth0 account from a bad actor signing in just to raise the amount of users and my billing?
  - Would deleting the user in the same rule help?

On the database side we have pre-registration hooks to handle this scenario. What is the way to do this with social connections?.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 5, 2020, 10:04pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/3 "2020-10-05T22:04:35Z")

</div>

Hi @diego.torres,

I think using the rule as you have described is the best way to go about this at the moment. As you mentioned, there is no pre-reg hook to handle this, which means we must use rules.

It’s possible to delete the user in the rule. Are you expecting a lot of this type of signup?

---

<div class="post-metadata">

**Author:** ![diego.torres](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/diego.torres/32/13443_2.png) [@diego.torres](https://community.auth0.com/u/diego.torres)\
**Post date:** [October 6, 2020, 2:50am UTC](https://community.auth0.com/t/limiting-social-signups/50961/4 "2020-10-06T02:50:40Z")

</div>

The actual number of valid users I’m expecting is in the low hundreds so I have room to work, but this feels like a vulnerability. Somebody can consume resources from my Auth0 account and I don’t have a way to prevent it. Is this correct?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 6, 2020, 3:26pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/5 "2020-10-06T15:26:20Z")

</div>

Since the user is never issued a token, I suspect they won’t count towards quota but will need to confirm this.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 6, 2020, 8:24pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/6 "2020-10-06T20:24:26Z")

</div>

I can confirm, if the user is not issued a token in this instance they are not counted towards your quota. You can delete them in the rule if you’d like, but that is up to you.

---

<div class="post-metadata">

**Author:** ![diego.torres](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/diego.torres/32/13443_2.png) [@diego.torres](https://community.auth0.com/u/diego.torres)\
**Post date:** [October 6, 2020, 9:18pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/7 "2020-10-06T21:18:29Z")

</div>

Thanks, that’s what I needed to know.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [October 6, 2020, 9:18pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/8 "2020-10-06T21:18:48Z")

</div>

No problem, let us know if you have any other questions.

---

<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:** [October 21, 2020, 9:19pm UTC](https://community.auth0.com/t/limiting-social-signups/50961/9 "2020-10-21T21:19:00Z")

</div>

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