We are using B2C for a number of Apps. Each app is owned by a separate team and currently each team has its own nonprod and prod B2C tenants.
The number of apps will definitely grow. We want to use fewer tenants going forward. To be precise, we want to use just 2 tenants for all apps. 1 nonprod and 1 prod. The major concern in this approach is that we currently give the developers app registrations for client credentials grant with permissions such as User.ReadWrite.All & Directory.ReadWrite.All at the tenant level. So, there is the possibility that the actions of a developer for one team/app will inadvertently affect users for another app. To this end, we are looking to create a wrapper User Management API around Graph API and also a front end to this new API. User Management admins will authenticate at the front end and use the custom API, which makes calls to Graph API. The hope is that with this setup, only the custom API will use client credentials grant with the Graph API permissions. The User Admins will authenticate to login to the front end web app to use the custom API.
Questions
- Is this a correct approach to achieve our long term goal of using much fewer tenants? What are the alternatives?
- Regarding the custom API/frontend setup. One way we are thinking to implement is to use a dedicated B2C tenant for the User Management admins. This tenant will contain one app registration for the custom API. Scopes will be exposed on this API. The custom API will use client credentials grant to perform CRUD operations on other B2C tenants. There will be a second app registration for the web app frontend which will be assigned permissions exposed on the custom API. Is this doable and if not, what options are available?
- The second approach we are thinking about for the API/frontend setup is similar but, we want to make the frontend web app multi-tenant so that the user management admins don't have to have accounts in the tenant that houses the custom API and frontend as they already have accounts in their respective B2C tenants. How can one achieve multi-tenant support in B2C and will it work for this scenario?