user9510595
user9510595

Reputation:

firebase authentification one user

I am creating a login for my chrome extension where I am going to be using the firebase email and password.

I am going to be putting the create User firebase code on my website and when someone can enter in there email and the script will create a random set of digits and set that as the password. It will then email that password to the user and the user uses the email he entered and the random digit password he received via email to login.

My question is If a user signs up and then logs in with his email and password. Whats to stop him from giving that email and password to his friend and he also logs in. I want to control the amount of users I allow within my chrome extension and only want the person who logged in to use the chrome extension (I want so the login can only be used once) Is this possible for firebase or not?

Also If anyone knows a simpler method than that I described above with sending the email please let me know becuase to do that above I have to create something that sends an email and creates the password.

I would also like to know if firebase has something where I can set a date on a user and after that date passes the user is logged out and has to register again.

But my main question is that if a user where to register if he has the ability to share the login with his friend or if only he can use it.

I really appreciate your reply and help on my issue in advance Thanks A lot.

Upvotes: 0

Views: 78

Answers (1)

Ian Barber
Ian Barber

Reputation: 19960

You'll likely have to do this from the server side (e.g. in a Cloud Function).

One option would be to use the session management features in the auth admin SDK: https://firebase.google.com/docs/auth/admin/manage-sessions - if you report back from the extension with the logged in user, you can revoke access for users who are seen in too many places at the same time. This limit might not be 1 - you may want to allow your users to log in on multiple machines at once.

For even more control, look at the option for managing your own session cookie: https://firebase.google.com/docs/auth/admin/manage-cookies - this allows you to set your own expiry and control the logged in state more granularly.

Upvotes: 1

Related Questions