简体   繁体   English

使用OpenID for Multilingual网站登录yahoo

[英]Login with yahoo using OpenID for Multilingual site

I am integrating yahoo open ID for my site. 我正在为我的网站集成yahoo开放ID。 My site is running for different languages( en, jp, cn etc.). 我的网站正在以不同的语言运行(en,jp,cn等)。 When I am trying to logged in from english site with yahoo opend ID then its fine but when the same this I tried from japanese or chinese site then it's not redirecting me to yahoo open id login. 当我尝试使用yahoo从开放的ID的英文网站登录时,它的状态很好,但是当我尝试从日语或中文站点进行的登录时,它并没有将我重定向到yahoo的开放ID登录名。

Each time I am getting the below error from javascript 每次我从javascript中收到以下错误

Error: The character encoding of the plain text document was not declared. 错误:未声明纯文本文档的字符编码。 The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. 如果文档包含来自US-ASCII范围之外的字符,则在某些浏览器配置中,文档将呈现乱码。 The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature. 需要在传输协议中声明文件的字符编码,或者文件需要使用字节顺序标记作为编码签名。 Source File: http://uatstorefrontjpcr.mobi-book.com/ReturnFromSocial/LogOnYahoo Line: 0 源文件: http : //uatstorefrontjpcr.mobi-book.com/ReturnFromSocial/LogOnYahoo行:0

Can anyone suggest what to do. 任何人都可以建议该怎么做。

I have used SocialAuth-net.dll for this purpose. 我已经为此目的使用了SocialAuth-net.dll。 I have set all required wrapper in web.config. 我已经在web.config中设置了所有必需的包装器。 Same coding is okay with Google and facebook open ID. 使用Google和Facebook开放ID可以进行相同的编码。

Your web server is probably sending back a response with a Content-Type of text/plain . 您的Web服务器可能正在发回Content-Typetext/plain的响应。 When a web browser receives a response with that content type, it doesn't know what encoding should be used to decode it; 当网络浏览器收到具有该内容类型的响应时,它不知道应该使用哪种编码来对其进行解码。 since you haven't told it how to decode it, different browsers might choose different ways. 由于您没有告诉它如何解码,因此不同的浏览器可能会选择不同的方式。

The solution is to provide an explicit encoding. 解决方案是提供显式编码。 For example, if you know that the text is UTF-8 encoded, then you could provide it in a header like so: 例如,如果您知道文本是UTF-8编码的,则可以在标头中提供它,如下所示:

Content-Type: text/plain; charset=UTF-8

According to an informational page from the W3C, you can get ASP.Net to include that bit in the header using Response.ContentEncoding . 根据W3C 的参考页 ,您可以使用Response.ContentEncoding获得ASP.Net将该位包含在标头中。 Again using UTF-8 as an example, you can set it like so: 再次以UTF-8为例,可以这样设置:

Response.ContentEncoding = Encoding.UTF8;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM