Angular 7, msal.js, msal-angular.js and AzureAD B2C (Email provider).
I have 3 resources:
- /home (no auth is required)
- /RoleA (only authorized users with Role A can access)
- /RoleB (only authorized users with Role B can access)
I have the following routes:
const routes: Routes = [
{ path: '', redirectTo: '/home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: '', component: MainLayoutComponent, canActivate : [MsalGuard], children:[
{ path: 'rolea', component: RoleAComponent },
{ path: 'roleb', component: RoleBComponent }
]}
];
I have authentication working, however, there is no example of how MSAL would work with groups (assuming that Azure AD B2C groups are equivalent to roles)
This SO is old and discussing server-side: Authorize By Group in Azure Active Directory B2C
I couldn't find the required documentation or code to communicate between MSAL and Groups to implement a role-based access, any help would be appreciated.