使用MSAL验证租户在多元反应应用中
我们正在努力将某些应用程序从剃刀页面移动以进行反应,我们希望使用Microsoft Identity平台通过MSAL进行身份验证。
其中一些应用程序是多租户,我们希望能够验证用户登录时设置和授权给定的租户。今天,我们通过ontokenvalidated
在.NET中进行此操作。通过从令牌索赔中提取电子邮件域或租户ID,并将其与我们的应用程序授权租户列表进行比较。
在MSAL中,我还不清楚如何实现这一目标。 MS文档说:“如果您允许多租户身份验证,并且不希望允许所有Microsoft帐户用户使用您的应用程序,则必须提供自己的方法,将代币发行人过滤给只有允许登录的租户””””” https://github.com/azuread/microsoft-authentication-library-for-js/blob/dev/lib/lib/msal-angular/docs/multi-tenant.md.tenant.md#md#mmulti-tenant” rel =“ nofollow noreferrer”> https://github.com/azuread/microsoft-authentication-library-for-for-js/blob/dev/lib/lib/lib/mmsal-angular/docs/multi-tenant.md.md#multi-tenant.md#multi-tenant )。
在React登录或令牌采集过程中,我可以检查索赔以执行此过滤?其他人如何在像React这样的水疗前端框架上与MSAL一起处理这类检查?
We're working on moving some apps from Razor Pages to React, and we'd like to use Microsoft Identity Platform for authentication via MSAL.
Some of these apps are multi-tenant, and we want to be able to validate that a given tenant is set up and authorized when a user logs in. Today, we do that in .NET via the OnTokenValidated
event by pulling the email domain or tenant ID from the token claims and comparing it to our app's list of authorized tenants in our databases.
In MSAL, I'm not entirely clear how to accomplish that. The MS docs say, "If you allow multi-tenant authentication, and you do not wish to allow all Microsoft account users to use your application, you must provide your own method of filtering the token issuers to only those tenants who are allowed to login" (in https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/multi-tenant.md#multi-tenant).
Where in the React login or token acquisition process can I inspect the claims in order to perform this filtering? How are others handling these kinds of checks with MSAL on a SPA front-end framework like React?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论