如何使用跨域查询进行身份验证
我想将我的应用程序与其他网站集成.在这种情况下,我的网站将代表用户向其他网站发送发帖请求,因此这将在用户浏览器中设置cookie,而不是将用户重定向到该网站,因此用户不需要提供身份验证详细信息.
i want to integrate my application with other web site .in this my web site will send post request to some other web site on behalf of the user so this will set cookies in user browser than it will redirect user to that site so user does not need to provide authentication detail.
由于ajax不会调用跨域,因此该如何实现呢?
How can i implement this since ajax does not make call to cross domain.
以下是有关如何使用AJAX进行跨域调用的示例: http://coding4life.wordpress.com/2012/03/30/制作跨域通话信号/ (免责声明:这是我的个人博客)
Here is an example on how you can do cross domain calls with AJAX: http://coding4life.wordpress.com/2012/03/30/making-cross-domain-calls-in-signalr/ (Disclaimer: It's my personal blog)
它使用SignalR,但在内部使用jQuery.要在jQuery中激活跨域调用,您必须使用:
It uses SignalR, but internally this is using jQuery. To active cross domain calls in jQuery you have to use:
jQuery.support.cors = true