将OpenAM与Spring security saml2 example一起使用时,我遇到了问题。
我已经按照this教程配置了Spring saml2示例以及OpenAM。现在,在选择 http://localhost:8080/OpenAM-12.0.0 并单击登录后,我收到错误,但浏览器返回" HTTP状态500 - SAML请求无效。"。
示例项目和OpenAM都部署在同一个tomcat服务器中,但我没有在任何日志中获得任何异常。
我已在下面附加了从网址中提取的已解码的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>
答案 0 :(得分:1)
“SAML请求无效”错误消息通常意味着某种信任问题,我认为您应该检查OpenAM中配置的信任圈以查看它是否包含所有相关实体,如果包含所有相关实体,那么请确保SP在发出请求时也使用了正确的entityID(在Issuer
字段内)。
在任何情况下,您都不应该使用“localhost”部署OpenAM(否则您稍后会看到cookie出现问题)。