angular - Angular、MSAL 和 Azure AD B2C 与组
问题描述
Angular 7、msal.js、msal-angular.js 和 AzureAD B2C(电子邮件提供商)。
我有 3 个资源:
- /home(不需要身份验证)
- /RoleA(只有角色 A 的授权用户可以访问)
- /RoleB(只有具有角色 B 的授权用户才能访问)
我有以下路线:
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 }
]}
];
我有身份验证工作,但是,没有 MSAL 如何与组一起使用的示例(假设 Azure AD B2C 组等效于角色)
这个 SO 很旧,正在讨论服务器端: Azure Active Directory B2C 中的按组授权
我找不到在 MSAL 和组之间进行通信以实现基于角色的访问所需的文档或代码,我们将不胜感激。
解决方案
推荐阅读
- android - React 本机 apk 不在设备上运行
- vba - 从 MS Project 中的 ODBC 获取数据
- python - 编译后 cx_freeze 和 cryptodome 错误
- python - 使用python发送电子邮件时出错
- java - 是否可以在单个项目中的 Maven 模块下添加 Apache Ant 模块作为依赖项
- javascript - 通过单击父项填充 iframe 输入字段
- java - 测试 Java Web 应用程序库的依赖关系
- sql - 选择行直到运行总和达到特定值
- dropbox - 使用 Dropbox 选择器 API 时出现错误 400
- sql - 在 Firebird 数据库上使用 SQL 标记满足特定条件的记录