SharePoint Online Provider托管的加载项-显示来自加载项的SharePoint图像(跨域调用) [英] SharePoint Online Provider Hosted Add Ins - Display SharePoint Images from Addin (Cross-Domain call)

查看:98
本文介绍了SharePoint Online Provider托管的加载项-显示来自加载项的SharePoint图像(跨域调用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

Hello,

 

我想开发一个提供程序托管的加载项,并显示存储在SharePoint Online库或Office 365私有CDN中的图像.问题在于该外接程序将在与SharePoint Online不同的域中运行,从而使对图像的访问成为跨域 称呼.如果用户未针对SharePoint进行身份验证(即使用户在外接程序中已通过身份验证),则由于未经授权的访问,该图像也不会显示.

I want to develop a provider-hosted addin and display images that are stored in SharePoint Online libraries or Office 365 Private CDN. The problems is that the addin will run in a different domain than SharePoint Online, making access to images a cross-domain call. If user doesn't authenticate against SharePoint (even if the user is authenticated in the addin), the image will not be displayed due to unauthorized access.

我选择提供程序托管的加载项是因为我需要一个Web应用程序,在该应用程序中我可以完全控制呈现的html,并且当前在SharePoint之上进行开发的选项不允许这样做(可能在将来SPFx带来这种可能性时) 开发整页的内容)

My choice for a provider-hosted addin is because I need a web application where I have complete control over the rendered html and the current options of developing on top of SharePoint do not allow this (possibly in the future when SPFx brings the possibility of developing full pages),

 

在不让用户在SharePoint中进行身份验证的情况下,显示图像的最佳方法是什么.

What the best approach in order for the images to be displayed without having the user to be authenticated in SharePoint.

 

必须以沉浸式整页体验呈现该外接程序,而不显示任何SharePoint Online元素(应用启动器,左侧导航,顶部导航等).

The addin must be rendered in an immersive full page experience, without showing any of the SharePoint Online elements (App Launcher, left navigation, top navigation, etc).

 

该应用程序的BackOffice将是SharePoint Online,包括发布页面中的内容表示(图像,视频等,可能会使用Office 365私有CDN存储在SharePoint Online中).

BackOffice for the app will be SharePoint Online including the presentation of content in publishing pages (images, videos, etc that will be stored in SharePoint Online, possibly using Office 365 Private CDN).

 

我可以想到一些可能性:

I can think of some possibilities:

 -实现一种始终以编码后的base64返回图像的方式-我不是这个选项的狂热者,因为它会强制通过对服务的请求来呈现每个图像,并且这会增加页面有效负载,并且如果我缓存数据的大小的 我需要存储在缓存中的信息(存储byte []或base64编码的字符串而不是简单的url)

 - Implementing a way to always return images in encoded base64 - I am not an enthusiast of this option since it forces every image to be rendered through a request to a service and it increases both the page payload and if I cache data the size of the information I need to store in cache (store byte[] or the base64 encoded string instead of a simple url)

-将外接程序嵌入到SharePoint页面中-这里的主要挑战是如何确保可以将外接程序嵌入整个页面中,隐藏所有SharePoint元素

- Having the addin to be embedded in a SharePoint page - the main challenge here is how to ensure I can embed the addin in a full page, hiding all the SharePoint elements

 

我不喜欢到目前为止我认为的方法.有人可以帮忙吗?

I don't like the approaches I thought so far. Can anyone help?

 

我在网上找到了一些与此相关的链接:

Some of the links I found in the web around this:

 

https://blogs.msdn.microsoft.com/richard_dizeregas_blog/2014/06/27/displaying-cross-domainsecure-ima... - Displaying Cross-Domain/Secure Images from SharePoint Apps – Richard diZerega's Blog

https://mysharepointlearnings.wordpress.com/tag/provider-hosted-appadd-in/ - Provider Hosted App/Add-In | My SharePoint Learnings

https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/cross-domain-images-in-sharepoint-... - Cross-domain images in SharePoint provider-hosted add-ins | Microsoft Docs

https://nathanwellsblog.com/tag/sharepoint-cdn/ -SharePoint CDN – Nathan Wells

https://nathanwellsblog.com/tag/sharepoint-cdn/ - SharePoint CDN – Nathan Wells

 

谢谢,

米格尔(Miguel)

Miguel

推荐答案

根据我的测试,如果用户在SharePoint中进行了身份验证然后请求加载项,图像将正确显示.



此行为是上下文令牌流所必需的,您可以在下面的线程中查看更多详细信息.


最好的问候,

Lee


这篇关于SharePoint Online Provider托管的加载项-显示来自加载项的SharePoint图像(跨域调用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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