firebasegoogle-cloud-firestorefirebase-realtime-databasefirebase-authenticationprogressive-web-apps

Managing Users separately for the Mobile PWA and Web app using Firebase as DB


Scenario:

I have two applications for the Company.

  1. Mobile PWA app.
  2. Web-based app.

Database: Firebase User Creation: Adding a user using the Authentication option in Firebase.

When a user is created using Firebase, the user will act as an admin for both Mobile PWA and Web-based apps.

Currently, the user(admin) is sharing the login credentials for both apps.

Problem: How the admin can add the users separately for the app and create user roles/groups, and user access in the application and password sharing be avoided among the users?

Note: Only one account will be added to the Firebase to access both the app. The users in the company don't have mobile phones or individual email IDs.

I am trying to find a solution where the admin can create an 'n' number of users in the application and the admin doesn't need to share his login credentials.


Solution

  • If you are tired of sharing admin login details and want to manage user roles and access more smoothly, here’s a quick rundown of what you can do:

    1. First off, think about different roles you need—like Admin, Manager, User. Each should have its own set of permissions. This way, everyone has just the access they need.
    2. Get an admin panel going for both your Mobile PWA and Web apps. This is where the magic happens. Admins can use it to add new users, assign roles, and tweak permissions without ever having to hand out their login info.
    3. For logins, stick with Firebase Authentication. It’s secure and keeps things tidy. Store all the role and permission data in Firebase Realtime Database or Firestore so everything stays synced up.
    4. Set up password reset features so users can handle their own password changes. This keeps everything secure and straightforward.

    Finally, build out that admin panel, organize your database for roles and permissions, use Firebase to handle logins, and make sure users can reset their passwords on their own. No more sharing admin credentials and everything’s managed in one place. Easy peasy!