如何获取 Azure Active Directory 发送的 saml 响应的属性?

How to obtain the attributes of a saml response sent by Azure Active Directory?

在使用 saml 2.0 进行处理时,我有一个 saml 响应给我 azure active directory,整个过程正常完成,我发送了一个 saml 请求和 azure active directory returns saml 响应,完成我基于此 guide 的整个过程,我已经阅读了一些内容并且我注意到 saml 响应中的 Azure AD 发送了此标记中的值:

<xenc:CipherData>
<xenc:CipherValue>VALUE HERE</xenc:CipherValue
</xenc:CipherData>

不在里面:

<AttributeStatement><Attribute Name="IDPEmail"><AttributeValue>administrator@contoso.com</AttributeValue></Attribute></AttributeStatement>

documentation. The question is, how to get the true values that azure active directory is sent to me and not these encoded values, I am using Python 3 and Google App Engine, in addition to mentioning azure active directory and saml 2.0 to do the login process, I leave the SAML response complete in this url 中所指定,以防它为我的问题提供更好的背景信息。

SAML 令牌已加密。

您需要获取用于此的客户端证书并使用它来解密。

如上所述,您收到的 SAML 响应已加密。具体来说,Azure 在名为 CipherData.

的加密体中加密其断言(包括您正在寻找的断言)

您有两个选择: 1 - 禁用 SAML 响应加密。 Azure AD 将 SAML 响应加密称为 SAML token encryption,这有点令人困惑。您可以按照此 guide 来禁用响应。您之前必须上传过加密 public key/cert。

2 - 配置您的服务提供商以支持加密的 SAML 响应。