【问题标题】:OpenAM + Spring Security SAML getting SAML Request is invalid responseOpenAM + Spring Security SAML 获取 SAML 请求是无效响应
【发布时间】:2015-05-19 11:09:26
【问题描述】:

在将 OpenAM 与 Spring security saml2 example 一起使用时遇到问题。

我已按照this 教程配置 Spring saml2 示例以及 OpenAM。现在我在选择 http://localhost:8080/OpenAM-12.0.0 并单击 login 后出现错误,但浏览器返回“HTTP Status 500 - The SAML Request is invalid.”。

示例项目和 OpenAM 都部署在同一个 tomcat 服务器中,但我在任何日志中都没有得到任何异常。

我在下面附上了从 URL 中提取的解码 SAML 请求。

<?xml version="1.0" encoding="UTF-8"?>
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
    AssertionConsumerServiceURL="http://localhost:8080/sso/saml/SSO"
    Destination="http://localhost:8080/OpenAM-12.0.0/SSORedirect/metaAlias/idp"
    ForceAuthn="false" ID="a436bg49hb19hhe73i2c450iadb7c8d" IsPassive="false"
    IssueInstant="2015-03-16T12:14:31.468Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
    Version="2.0">
    <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">http://localhost:8080/sso/saml/metadata</saml2:Issuer>
</saml2p:AuthnRequest>

【问题讨论】:

  • 你打开OpenAM的调试日志了吗,如果没有,看看你是否得到了一些有用的东西

标签: java spring-security openam


【解决方案1】:

“SAML 请求无效”错误消息通常意味着某种信任问题,我认为您应该检查 OpenAM 中配置的信任圈以查看它是否包含所有相关实体,如果包含,则制作确保 SP 在发出请求时也使用正确的 entityID(在 Issuer 字段内)。

无论如何,您都不应该使用“localhost”部署 OpenAM(否则您稍后会看到 cookie 出现问题)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-02
    • 2013-07-12
    • 2015-01-21
    • 1970-01-01
    • 2015-05-29
    • 2020-02-26
    • 2017-07-27
    • 2014-12-26
    相关资源
    最近更新 更多