B2B Multi Tenants
Overview
Multi-tenant authentication allows multiple clients or organizations (tenants) to use a single instance of an application while keeping their data and configurations isolated. Eartho's concept of Spaces provides a powerful way to implement multi-tenant authentication and authorization, ensuring each tenant has secure and independent access to their resources.
Key Concepts
Spaces: Represent the individual tenants in a multi-tenant environment. Each space acts as an isolated container for access points and user data.
Access Points: Gateways provided by each space that allow users to access various resources within the tenant's environment.
Roles and Permissions: Define what different users within a space can do, ensuring proper authorization and access control.
Steps to Implement Multi-Tenant Authentication
Create a New Space for Each Tenant
Each tenant is represented by a space in Eartho. When a new tenant signs up, a new space should be created to encapsulate their data and access points. This can be managed through the Eartho Creators Dashboard.
Define Access Points for Each Space
Access points within each space define the gateways to different resources. For example, a tenant might have access points for login, admin panel, and user dashboard. These can be set up and configured through the Eartho Creators Dashboard.
Manage Roles and Permissions
Assign roles and permissions to users within each space to control what they can access and perform. Roles like "Admin," "Editor," and "Viewer" can be defined with specific permissions, all managed through the Eartho Creators Dashboard.
User Authentication and Authorization
When users log in, authenticate them against the access points of their respective spaces. Ensure that their roles and permissions are correctly applied, and managed entirely through the Eartho Creators Dashboard.
Handle User Management
Manage user profiles, including their roles and permissions, within the context of their spaces. Ensure that user data remains isolated and secure, with all operations performed through the Eartho Creators Dashboard.
Example Workflow
Tenant Signup: When a new tenant signs up, create a new space for them through the Eartho Creators Dashboard.
Setup Access Points: Define the access points for the tenant's space using the Eartho Creators Dashboard.
User Signup and Role Assignment: Add users to the tenant's space and assign roles via the Eartho Creators Dashboard.
User Authentication: Authenticate users based on their space and access points, managed through the Eartho Creators Dashboard.
Access Control: Ensure users can only access resources defined by their roles and permissions, configured through the Eartho Creators Dashboard.
Last updated