简体   繁体   English

Ajax呼叫adfs背后的休息服务

[英]Ajax call to a rest service behind an adfs

I am exposing some Rest services through an MVC 4 (.net) project. 我通过MVC 4(.net)项目公开了一些Rest服务。 They are deployed behing an adfs authentication server. 它们部署在adfs身份验证服务器上。 Other applications, that are behind the same ADFS are calling my services through ajax calls. 同一ADFS后面的其他应用程序正在通过ajax调用来调用我的服务。

The problem is that the calls are stuck on the adfs. 问题在于调用被卡在adfs上。 Even though the user was authenticated when he logged into the application, the auth cookie is under the app domain, and obviously not in the services server domain. 即使用户登录到应用程序时已通过身份验证,但auth cookie仍在应用程序域下,并且显然不在服务服务器域中。

The cookies are locked under httpOnly, so i can't duplicate them for my services server (justifiably so). 这些cookie锁定在httpOnly下,因此我无法为我的服务服务器复制它们(理应如此)。 Is there a way to "steal" the cookies, or maybe another work around? 有没有办法“窃取” Cookie,或者有其他解决方法?

I think you are using Web API services. 我认为您正在使用Web API服务。 If so, please check whether your services are CORS support enabled or not. 如果是这样,请检查您的服务是否已启用CORS支持。

Please go through http://brockallen.com/2012/06/28/cors-support-in-webapi-mvc-and-iis-with-thinktecture-identitymodel/ 请通过http://brockallen.com/2012/06/28/cors-support-in-webapi-mvc-and-iis-with-thinktecture-identitymodel/

it may helps you. 它可能会帮助您。

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

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