如何使用跨域查询进行身份验证 [英] How to authenticate using cross domain query

查看:186
本文介绍了如何使用跨域查询进行身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的应用程序与其他网站集成.在这种情况下,我的网站将代表用户向其他网站发送发帖请求,因此这将在用户浏览器中设置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

这篇关于如何使用跨域查询进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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