In this section, we'll reconfigure the application to work as a multi-tenant application that you can use from other Azure AD tenants or a Microsoft personal account. With the following configuration we migrate the application:
- Open the
Startup.cs
file in your solution:- Comment the
ConfigureAuth(app)
line - Uncomment the
ConfigureMultitenantAuth(app)
line:
- Comment the
![](https://static.packt-cdn.com/products/9781789132304/graphics/a341bf0c-947b-49c6-abf9-3d9c62729a15.png)
Modifying the code for multi-tenant usage
- Change the
ida:TenantId
value to our Azure AD domain name:
![](https://static.packt-cdn.com/products/9781789132304/graphics/17ed5589-3675-41f6-8ca4-4c5a31ca0df2.png)
Changing the tenant ID
![](https://static.packt-cdn.com/products/9781789132304/graphics/ed9db31d-4606-4c12-b681-88ef77be6b90.png)
Check the role assignment for the newly created app
- Reassign the roles to the users:
![](https://static.packt-cdn.com/products/9781789132304/graphics/9950389a-f699-4b03-a66e-c7f89a7c2f27.png)
Reassign roles
![](https://static.packt-cdn.com/products/9781789132304/graphics/be7de434-dbd0-4a80-af44-eabea4488712.png)
Check the login with the guest user account