azure-active-directory - iframe 中的 Azure AD MSAL

标签 azure-active-directory azure-ad-msal msal.js

我有一个受天蓝色广告保护的网站并使用 msal,我想在 iframe 中访问它,但它看起来不起作用。有办法让它发挥作用吗?是否与重定向网址或其他问题有关?

最佳答案

您无法在 iframe 内对用户进行身份验证,这意味着您无法使用重定向 API 来进行用户与身份提供商的交互。

您可以从创建自己的客户页面开始,并允许用户输入凭据,然后对用户进行身份验证。当用户输入凭据并单击登录时,服务器将返回“确定”(如果电子邮件/密码正确)。之后,您应该将 token 保存在本地存储中,然后设置 isAuthenticated = true。

如果您使用身份验证代码流程,那么您应该在外部真实页面而不是 iframe 内进行身份验证。然后,一旦您通过身份验证,您将必须登录。这个概念是,您必须完全重定向到天蓝色广告中的身份验证页面,而不是 iframe 中的身份验证页面。

You can achieve single sign-on between iframed and parent apps with the same-origin and with cross-origin if you pass an account hint from the parent app to the iframed app.

了解更多 here

关于azure-active-directory - iframe 中的 Azure AD MSAL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67324152/

相关文章:

javascript - 如何获取 Azure AD OAuth 登录的登录用户配置文件?

azure - "Content not available"Power BI 嵌入带有 azure 身份验证 token 的 ionic 应用程序

c# - Microsoft Graph API - 以其他用户身份发送电子邮件

azure - 如何在Azure中自定义用户属性的类型?

c# - AcquireTokenForClient (MSAL) 是否使用 token 缓存?

使用 React SPA 的 msal token 超时

azure - 针对 Azure 中 VM 的自定义指标

c# - AAD Graph API 权限问题

javascript - 如何清除 MSAL SPA 中的缓存 token ?