0

I was wondering if I can restrict sign in using firebase authentication for web to users with a certain email address, for example, I want only my colleges in the company to sign in (we all have gmail accounts with a custom domain).

If such a feature is not possible I was thinking about validating the email address with javascript to make sure that it belongs to the same domain. but still, it will be nicer and more secure if there is a built-in feature to achieve it.

Joseph Kobti
  • 115
  • 7
  • u can use `contains()` in java so for example if a user is writing his email in the edittext. You can do a condition `if(txt.contains(@customdomain.com)){ //do watever, authenticate user}` – Peter Haddad Jan 28 '18 at 22:14
  • thanks for the tip, but i forgot to mention that I'm using firebase authentication for a static website, i have edited the question now however – Joseph Kobti Jan 28 '18 at 22:22
  • While you can't prevent users from signing in, you can limit access to database or files to users from a specific domain. See my answer to [this question](https://stackoverflow.com/questions/36943350/how-do-i-lock-down-firebase-database-to-any-user-from-a-specific-email-domain) for an example for the realtime database. – Frank van Puffelen Jan 29 '18 at 02:36

0 Answers0