Hercules

Users & AuthSign-in Rules

Build your appUsers & Auth

Sign-in Rules

Sign-in rules control who is allowed into your app. Keep sign-up open to everyone, or approve a list of email addresses and domains so only those people can create an account and sign in.

Where do I find sign-in rules?

Click Users & Access → Sign-in rules in your app sidebar.

Sign-in rules are available on apps using Hercules Auth 2.0. If your app was created before Hercules Auth 2.0, upgrade it first. Editing rules requires a Business plan or higher.

Who can sign up?

Pick one of three options under Who can sign up?:

  • Allow everyone: anyone who reaches your sign-in page can create an account. This is the default. Block rules still apply.
  • Only people I approve: only people who match an allow rule, and no block rule, can create an account or sign in. When you switch to it, Hercules adds your own email as a rule unless one already covers it.
  • Only SSO users: only people your organization's identity provider signs in can create an account or sign in, and your app's other sign-in methods are hidden. Block rules still apply. Turn on single sign-on in the Auth Portal tab first. People already signed in stay signed in until their session ends.

Confirm the change and it takes effect right away. Switching back to Allow everyone keeps your rules saved. Allow rules stop being enforced, and block rules keep applying.

How do I approve an email address or domain?

Choose Only people I approve under Who can sign up? first. In the other options, you can see the rule editor but not use it.

  1. Under Add sign-in rules, choose allow or block, then email addresses or domains.
  2. Paste the values into the box, one per line.
  3. Add a reason if you want a note about why they are approved (optional).
  4. Click Add sign-in rule.

Rules save as soon as you add them. Approve a domain like acme-corp.com to let in everyone with an email at that domain, or approve jane@acme-corp.com to let in one person. Add a block rule to keep out an address or domain that your other rules would let in.

Editing rules needs the Business plan.

How do I remove a rule?

Click the three dots at the end of the rule's row, then click Remove rule and confirm. The same menu has Change to block or Change to allow. To change several rules at once, select them and click Allow, Block, or Remove.

Removing a rule can immediately change who is allowed in. Anyone who no longer matches is signed out the next time they try to sign in.

What do blocked users see?

They see: "Your email address is not approved to access this app. Contact the app owner to request access." The message never reveals which rules exist or whether the address already has an account.

If you turn on Let people request access under Users & Access → Access requests, blocked users see an Access required screen where they can send you a request instead. Their request waits under Access requests until you approve or deny it. Approving adds an allow rule for them.

Are existing users affected?

Yes. Rules are checked when an account is created and again on every sign-in after that. Users who already have an account but do not match your rules are signed out at their next sign-in.

How are rules matched?

Matching is not case sensitive. A domain rule matches everything after the @ in the user's email address, and it has to match in full. Approving acme-corp.com does not let in jane@eng.acme-corp.com, so add each subdomain you want to approve. If an address matches both a block rule and an allow rule, the block wins.

Do Phone OTP and username accounts work with an allowlist?

Yes, as long as you approve the right value. Those accounts have a placeholder address in place of a real one: a username account uses the username followed by @username.invalid, and a Phone OTP account uses an address ending in @phone.invalid. Approving the username or the phone number on its own never matches. Open Users & Access, copy the full address shown on the account, and add it as an email rule. To approve every account of that kind at once, add a domain rule for username.invalid or phone.invalid.

How many rules can I add?

Up to 1,000 rules, with each email address or domain up to 255 characters.

What happens if my plan changes?

Rules you already saved keep being enforced, so your app's door stays shut rather than opening to everyone. You can still see the list and switch back to Allow everyone, but you need a Business plan or higher to edit rules or turn a restriction on.

What's next?

Manage Users

Manage users, roles, and permissions

Customize Login & Sign up

Customize login methods, branding, and domains