【发布时间】:2015-09-08 14:48:19
【问题描述】:
尝试在 wso2 Identity Server 5.0.0 + 服务包和第 3 方服务提供商之间设置 SAML。面临与another stack trace question 类似的问题,只是 SP 无法将 Destination 参数添加到其 samlp:AuthnRequest。
更具体一点。我收到的 samlp:AuthnRequest 如下所示:
<samlp:AuthnRequest
AssertionConsumerServiceURL='https://schoolname.academicworks.com/saml/callback'
ID='_388406f0-3581-0133-2bea-0610df7af2db'
IssueInstant='2015-09-04T22:21:32Z'
Version='2.0'
xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol'>
<saml:Issuer xmlns:saml='urn:oasis:names:tc:SAML:2.0:assertion'>https://schoolname.academicworks.com/saml-sp</saml:Issuer>
<samlp:NameIDPolicy AllowCreate='true' Format='urn:oasis:names:tc:SAML:2.0:nameid-format:persistent' xmlns:samlp='urn:oasis:names:tc:SAML:2.0:protocol'/>
</samlp:AuthnRequest>
此请求缺少目标参数。使用此请求,wso2 身份服务器会记录以下内容,并且 SAML 登录失败:
TID: [0] [IS] [2015-09-04 17:46:56,471] WARN {org.wso2.carbon.identity.sso.saml.processors.SPInitSSOAuthnRequestProcessor} - Destination validation for Authentication Request failed. Received: [null]. Expected: [https://ourhostname.ourschool.edu:443/samlsso] {org.wso2.carbon.identity.sso.saml.processors.SPInitSSOAuthnRequestProcessor}
我在 SAML 文档中找不到需要 Destination 参数的任何地方,但 Identity Server 似乎确实这么认为。作为我参考的帖子,这个检查可以在源代码中找到
public class AuthnRequestProcessor
<snip>
// Validate 'Destination'
String idpUrl = IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_IDP_URL);
if (authnReqDTO.getDestination() == null
|| !idpUrl.equals(authnReqDTO.getDestination())) {
String msg = "Destination validation for Authentication Request failed. " +
"Received: [" + authnReqDTO.getDestination() + "]." +
" Expected: [" + idpUrl + "]";
log.warn(msg);
return buildErrorResponse(authnReqDTO.getId(),
SAMLSSOConstants.StatusCodes.REQUESTOR_ERROR, msg);
}
这在文件中:components/identity/org.wso2.carbon.identity.sso.saml/4.2.1/src/main/java/org/wso2/carbon/identity/sso/saml/processors/AuthnRequestProcessor .java
我可以破解源代码以删除对 null 的检查,但我会永远维护它。有人遇到过这个吗?有什么可用的解决方法吗?服务提供商无法添加此参数。
提前致谢,
约翰
【问题讨论】:
标签: wso2is