TransWikia.com

Display image from sharepoint online

SharePoint Asked on December 17, 2021

Our intranet site aaa.com has a page with img src=bbb.com/image.jpg.
bbb.com is a sharepoint online site.

Chrome blocks the image display with this error:

Cross-Origin Read Blocking (CORB) blocked cross-origin response <URL> with MIME type text/html.<br>
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://login.microsoftonline.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/oauth2/authorize?client_id...<br>

It appears sharepoint online is trying to authenticate.
This doesn’t happen when the src is to an sharepoint on-premises site.

How do i fix this?

I’ve googled quite a bit, but can’t tell if it’s a configuration issue on aaa.com (our intranet site) or a configuration on bbb.com (sharpoint online site).
I tried adding crossorigin="" and crossorigin="anonymous" to the image tag – no luck.

It appears we should be able load "media resources":
https://www.chromium.org/Home/chromium-security/corb-for-developers
https://developers.google.com/web/updates/2018/07/site-isolation

One Answer

You could try to convert the picture to base64 format.

https://www.eliostruyf.com/displaying-the-users-profile-picture-in-your-office-365-add-in/

You still need to get SharePoint authorization.

Or you could try to login in SPO in the browser and the picture will appear.

Answered by Amos on December 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP