我在本地主机上的MVC应用程序中使用LINQ进行身份验证。
我按照以下方式配置了我的twitter应用:

我使用本文实现了控制器:https://linqtotwitter.codeplex.com/wikipage?title=Implementing%20OAuth%20for%20ASP.NET%20MVC&referringTitle=Learning%20to%20use%20OAuth和我的方法BeginAsync和CompleteAsync与本文完全相同。但是我一直收到一个错误'XMLHttpRequest cannot load https://api.twitter.com/oauth/authorize?oauth_token=<myToken>. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1' is therefore not allowed access. '
我添加了Web.config:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
...
</system.webServer>但它仍然不起作用。
有什么想法吗?
发布于 2014-11-19 10:12:26
我认为这篇文章中的那个家伙没有使用ajax请求。twitter不支持CORS。
https://stackoverflow.com/questions/27012461
复制相似问题