【问题标题】:How do you disable WSO2 Identity Server's Destination parameter check for samlp:AuthnRequest?如何禁用 WSO2 身份服务器对 samlp:AuthnRequest 的目标参数检查?
【发布时间】: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


    【解决方案1】:

    Duh,答案是:如果 samlp:AuthnRequest 未签名,请确保取消选中服务提供者 -> 入站身份验证 -> SAML2 Web SSO 配置 -> 服务提供者上的“在身份验证请求中启用签名验证”复选框页面。

    该错误具有欺骗性,因为您会认为它会在丢失的签名上咆哮,但我猜丢失的 Destination 参数是它遇到的第一个错误。

    希望在此处发布此内容可以减轻其他人的痛苦。

    【讨论】:

    • 悲痛得救了。今天仍然有问题。
    猜你喜欢
    • 1970-01-01
    • 2015-07-18
    • 2015-07-22
    • 2012-11-18
    • 1970-01-01
    • 1970-01-01
    • 2020-07-11
    • 2014-01-18
    相关资源
    最近更新 更多