我们使用的是 spring-security-saml2-core 1.0.1.RELEASE
来验证我们在 Azure 云中运行的 ADFS。
认证失败,因为Azure正在预先处理该问题。'spn:'
至始至终 EntityId
在 <AudienceRestriction>
的一部分。这将导致类 org.springframework.security.saml.websso.WebSSOProfileConsumerImpl
以使请求失败,因为它希望 audience 字符串与 the EntityId
正是如此。
例如,如果SP EntityId
是 ca58424a-3338-4ac2-81ec-fe4a822f7fcd
和 auth 请求成功,Azure 会在受众限制响应中的 EntityId 中返回这个。
<Conditions NotBefore="2015-10-21T14:24:41.745Z" NotOnOrAfter="2015-10-21T15:24:41.745Z">
<AudienceRestriction>
<Audience>spn:ca58424a-3338-4ac2-81ec-fe4a822f7fcd</Audience>
</AudienceRestriction>
</Conditions>
不知道为什么Azure这样做,但这 Azure博客 确实提到 Azure 使用 SPN 格式。
这是否是一个已知的问题,是否有任何修复方法?
我通过预先提交 spn:
至始至终 EntityID
在web应用配置中。当这个传递到Azure时,它必须检查并删除该字符串,然后再比较该字符串的 EntityID
.