通过WS-美联储抛出验证XML错误 [英] Xml errors thrown via Ws-fed authentication

查看:167
本文介绍了通过WS-美联储抛出验证XML错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到发生在基于WIF-依赖第三方应用程序,我对工作日志,以下错误,无法重新创建该问题:

I'm seeing the following error occur in the logs of a WIF-based reliant-party application that I work on and can't re-create the issue:

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) 

读入可能的问题<一href=\"http://social.technet.microsoft.com/Forums/uk/sharepoint2010programming/thread/00bb20a1-0e7f-4c3e-a1d5-9b8b08462bab\"相对=nofollow>此Technet文章使我想到的问题是在张贴回从STS的RP的wresult参数,但我不能看到如何被送回错误的,除非它被篡改,并且,由于问题的体积似乎不太可能。

Reading into possible issues this Technet article led me to think the problem was in the wresult parameter that is POSTed back to the RP from the STS but I can't see how that is being sent back incorrectly unless it's being tampered with and that seems unlikely due to the volume of issues.

如果任何人都可以确认是什么原因导致这种类型的错误,以及如何就可能发生,它会是多少AP preciated。

If anyone can confirm what causes this type of error and how it may occur, it'd be much appreciated.

推荐答案

此错误含有一些html标签(如
,...)的XML的内容可能会发生或某些特殊字符像,/,......这可能会破坏XML模式。
你应该带code的任何HTML内容将它们添加到XML之前。

This error may occur as the content of the xml containing some "html tags" (such as
, ,...) or some special character like "", "/", ...that could break the Xml schema. You should encode any html content before adding them to the Xml.

更新:
也许你在配置WCF的web.config中绑定transferMode =流。只是删除。这可能至少是我的问题。

Updated: Maybe you config the binding in web.config of WCF is transferMode=STREAMED. Just remove that. That may be the problem at least for me.

这篇关于通过WS-美联储抛出验证XML错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆