我在我处理的基于 WIF 的依赖方应用程序的日志中看到以下错误,并且无法重新创建该问题:
CData elements not valid at top level of an XML document. Line 1, position 3.
Stack Trace: at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, XmlException exception)
at System.Xml.XmlUTF8TextReader.Read()
at System.Xml.XmlBaseReader.MoveToContent()
at Microsoft.IdentityModel.Protocols.WSFederation.WSFederationSerializer..ctor(XmlDictionaryReader reader)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.CreateSerializerForResultXml(String resultXml)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.GetXmlTokenFromMessage(SignInResponseMessage message)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.GetSecurityToken(SignInResponseMessage message)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request)
at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
阅读这篇 Technet 文章可能导致的问题,我认为问题出在从 STS 回传到 RP 的 wresult 参数中,但我看不出它是如何被错误地发回的,除非它被篡改,而且这似乎不太可能由于问题的数量。
如果有人可以确认导致此类错误的原因以及它是如何发生的,我们将不胜感激。