我有一个 SAML2 服务提供商,并且正在尝试使用 ADFS 身份提供商设置 SSO。目前我的服务提供商只使用 Okta 和 OneLogin。当他们启动身份验证(向我发送响应消息)时,它会成功,但是当从我这边启动身份验证(向他们发送 AuthnRequest 消息)时,ADFS 出错。
我无法确定原因,也不是很熟悉 ADFS。身份提供者(匿名)提供的错误日志有这个
Verbose,1/25/2019 8:37:10 AM,AD FS Tracing,70,None," Message after decoding: <?xml version=""1.0"" standalone=""yes""?>
<samlp:AuthnRequest xmlns:samlp=""urn:oasis:names:tc:SAML:2.0:protocol""
xmlns:saml=""urn:oasis:names:tc:SAML:2.0:assertion""
Destination=""https://exmaple.com/adfs/ls/""
ProviderName=""My SP's human readable name.""
AssertionConsumerServiceURL=""https://www.example.com/login/saml2/1234567/authenticate""
Version=""2.0""
IssueInstant=""2019-01-25T16:37:08Z""
ID=""IDcbe874446fa31fcb9c3f5868beab546b"">
<saml:Issuer>https://www.example.com</saml:Issuer>
<samlp:NameIDPolicy Format=""transient"" AllowCreate=""1"" />
</samlp:AuthnRequest>"
Error,1/25/2019 8:37:10 AM,AD FS Tracing,153,None,"Exception: MSIS0018: The SAML protocol message cannot be read because it contains data that is not valid.
StackTrace: at Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadNameIDPolicy(XmlReader reader)
at Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadAuthnRequest(XmlReader reader)
at Microsoft.IdentityServer.Protocols.Saml.HttpSamlBindingSerializer.ReadProtocolMessage(String encodedSamlMessage)
at Microsoft.IdentityServer.Protocols.Saml.HttpSamlBindingSerializer.CreateFromNameValueCollection(Uri baseUrl, NameValueCollection collection)
at Microsoft.IdentityServer.Protocols.Saml.HttpRedirectSamlBindingSerializer.ReadMessage(Uri requestUrl, NameValueCollection form)
at Microsoft.IdentityServer.Web.Protocols.Saml.HttpSamlMessageFactory.CreateMessage(WrappedHttpListenerRequest httpRequest)
at Microsoft.IdentityServer.Web.Protocols.Saml.SamlContextFactory.CreateProtocolContextFromRequest(WrappedHttpListenerRequest request, ProtocolContext& protocolContext)
at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.CreateProtocolContext(WrappedHttpListenerRequest request)
at Microsoft.IdentityServer.Web.PassiveProtocolListener.GetProtocolHandler(WrappedHttpListenerRequest request, ProtocolContext& protocolContext, PassiveProtocolHandler& protocolHandler)
at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
Exception: Invalid URI: The format of the URI could not be determined.
StackTrace: at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at Microsoft.IdentityServer.Protocols.Saml.SamlProtocolSerializer.ReadNameIDPolicy(XmlReader reader)
"
Error,1/25/2019 8:37:10 AM,AD FS Tracing,87,None,Passive pipeline error
我不确定这两个堆栈跟踪是不同的错误还是连接的。
我的服务提供商正在使用 Net::SAML2 perl 模块的略微修改版本。
我希望这只是 ADFS 所期望的一些属性或元素,但我没有提供,或者更好的是,他们这边的一些配置不正确。
什么可能导致此错误?