【问题标题】:AAD authentication fails in IE in iframeAAD 身份验证在 iframe 中的 IE 中失败
【发布时间】:2019-05-17 08:32:49
【问题描述】:

我有一个带有 iframe 的页面,其中显示了一个由 AAD SSO 验证的公司网站。

当我直接在 IE 中访问公司网站时,一切正常,但是当它在 iframe 中时,它重定向到 login.microsoft.com,然后返回并出现错误:

Forbidden: 

This corporate app can't be accessed.
You are not authorized to access this application
Azure AD Application Proxy 


Azure AD Application Proxy 

Status code:  Forbidden 

Url:  https://mycorporatesite/%3ferror%3daccess_denied%26error_description%3dAADSTS50105%253a%2bThe%2bsigned%2bin%2buser%2b%2527%2... 

 TransactionID:  2656c424-9b94-4af7-8ed3-123b65b6fef9 

 ConnectorGroupId:  b58ad765-2dc9-443e-bed8-70558cc3f463 

 Timestamp:  5/20/2019 7:26:57 AM 

它适用于除 IE 之外的所有浏览器,包括 Edge(即使在私人模式下)

我必须提到,我的电脑连接到网站使用的不同 AD,但正如我所提到的,当我直接访问该网站时它工作正常。

以下是 iframe 发出的请求:

GET https://mycorporatesite.com/RestApi/?SPHostUrl=.....
Response 302 / Found
Response Headers: location: https://login.microsoftonline.com/{tenant}/oauth2/authorize?response_type=code&client_id=...

GET https://login.microsoftonline.com/{tenant}/oauth2/authorize?response_type=code&client_id=...
Response 302 / Found
Response Headers: location: https://mycorporatesite.com?error=access_denied&error_description=AADSTS50105%3a+The+signed+in+user+%27%7bEmailHidden%7d%27+is+not+assigned+to+a+role+for+the+application+...

GET https://mycorporatesite.com?error=access_denied&error_description=AADSTS50105%3a+The+signed+in+user+%27%7bEmailHidden%7d%27+is+not+assigned+to+a+role+for+the+application+...
Response 403 / Forbidden

【问题讨论】:

  • 当用户未分配给 Azure Active Directory 中的应用程序时,或者在后端用户无权访问应用程序时,可能会发生此错误。请参阅这些链接以获取更多信息。 docs.microsoft.com/en-us/azure/active-directory/manage-apps/…github.com/Huachao/azure-content/blob/master/articles/…
  • 您能否将错误中提到相关 ID 和时间戳的部分包括在内?
  • @deepak-MSFT - 我理解错误,但它不应该发生,因为我可以直接访问该站点。为什么它发生在 iframe 中?我猜 iframe 选择了错误的用户
  • 尝试从 iframe 打印用户相关信息以检查它正在使用哪个用户可能有助于缩小问题范围。
  • 我已编辑 anwser 以包含所有错误详细信息,但只有事务 ID、时间戳和 ConnectorGroupId。我几乎可以肯定 IE IFrame 使用的是我连接到 Windows 的帐户。

标签: internet-explorer iframe azure-active-directory single-sign-on


【解决方案1】:

这可能与浏览器无关。是否有可能在其他浏览器中使用其他用户登录 Azure AD?

当应用程序要求将用户分配给应用程序,但未分配登录用户时,会返回您看到的错误消息。

【讨论】:

  • 不,事实并非如此。正如我所说,我可以在同一会话的同一窗口中的同一浏览器中直接访问该页面,因此我使用正确的用户进行了签名。
  • @Liero 错误消息中标识的用户(在 iframe 中时)是否与您在全帧中访问该站点时登录的用户相同?
  • 好吧,我不知道 iframe 使用的是什么用户,但我猜它的用户不同 - 来自 windows 的用户。我不知道如何找到
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-01-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多