SharePoint 2013应用程序:无法完成跨域调用以从SharePoint获取用户详细信息。您的域与此应用部署的预期域不匹配 [英] SharePoint 2013 apps : Could not complete cross-domain call to get User details from SharePoint. Your domain doesn't match the expected domain for this app deployment

查看:86
本文介绍了SharePoint 2013应用程序:无法完成跨域调用以从SharePoint获取用户详细信息。您的域与此应用部署的预期域不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经构建了一个SharePoint提供程序托管应用程序。从远程网络我试图对SharePoint进行跨域REST调用但它失败并且在REST调用的错误处理程序中它显示

I have built an SharePoint provider hosted app. From the remote web I am trying to make cross domain REST call to SharePoint but it is failing and in error handler of REST call it shows

"无法完成交叉域名调用从SharePoint获取用户详细信息。您的域名与此应用程序部署的预期域名不匹配"

"Could not complete cross-domain call to get User details from SharePoint.Your domain doesn't match the expected domain for this app deployment"

SharePonit能够成功重定向到应用程序并且远程网页正常打开来自此REST呼叫失败。我检查了应用程序域,就像是

SharePonit is able to redirect to app successfully and remote web page is opening properly apart from this REST Call failure. I Checked the app domain it is like 

在SP中注册的应用程序域:mysite.com

App domain registered in SP : mysite.com

应用程序重新调整: 应用程序

Apps refix :   apps

远程网络在IIS中指定的主机标头为"mysite"

Remote web is having host header specified in IIS as "mysite"

等待一些有用的指示 

推荐答案

根据您的帖子,我的理解是您在SharePoint应用中遇到了跨域错误。

According to your post, my understanding is that you get the cross domain error in SharePoint app.

据我所知,这是因为有一个当我们使用从app web到主机web的REST调用时跨域问题。

Per my knowledge, that’s because there is a cross domain issue when we use REST call from app web to host web.

要解决此问题,我们可以使用 SP.RequestExecutor .js,这是来自SharePoint的跨域文件。

To resolve this issue, we can use the SP.RequestExecutor.js, this is the cross-domain file from SharePoint.

http://blogs.msdn.com/b/officeapps/archive/2012/11/29/solving-cross-domain-problems-in-apps-for -sharepoint.aspx

更多参考资料:

http://weshackett.com/2014/02/sp-requestexecutor-cross-domain-calls-using-rest-gotcha/

http:// cann0nf0dder。 wordpress.com/2013/04/14/cross-domain-and-sharepoint-hosted-apps-using-rest/

谢谢,

Jason

论坛支持

如果答案有帮助,请记得将答案标记为答案,如果答案没有提供帮助,请取消标记。如果您对TechNet订户支持有反馈,请联系
tnmff@microsoft.com

Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


这篇关于SharePoint 2013应用程序:无法完成跨域调用以从SharePoint获取用户详细信息。您的域与此应用部署的预期域不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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