Image past times Jon Moore on Unsplash
I’m creating a couplet of solution these days which volition listing Office 365 Groups, both populace in addition to private, every bit good every bit Groups you lot don’t stimulate got access to. Much similar the discovery component subdivision you lot stimulate got inwards Outlook, except alongside added filtering on custom metadata for the groups.
Querying for Office 365 Groups using the Microsoft Graph is quite easy, exactly retrieving an icon URL for the groups logo, is inherently hard, peculiarly if you lot don’t stimulate got access to the group.
The available options every bit far every bit I stimulate got discovered are every bit follows:
- Retrieve the icon blob from the MS Graph, in addition to larn the base64 encoded version using JavaScript. This ever works, exactly you lot potentially destination upward alongside many Graph calls. If this telephone phone was non a REST call, exactly could hold out used every bit an icon URL directly, at that spot would hold out no employment at all.
- If the user stimulate got an active session against Outlook Web, you lot tin telephone phone https://outlook.office365.com/EWS/Exchange.asmx/s/GetUserPhoto?email=group@email.address
However, if the user does non stimulate got an active session, it fails.
- If the user stimulate got an active session against Planner, you lot tin call
">https://tasks.office.com/innovationnorway.onmicrosoft.com/Groups/GetGroupPhoto?groupId=<groupid>
However, if the user does non stimulate got an active session, it fails.
- Link to the Groups logo via the SharePoint site
https://tenant.sharepoint.com/teams/YourGroup/SiteAssets/__siteIcon__.jpg
As long every bit you lot stimulate got access to the site it works, if not, well, the icon won’t load
A forth pick is too possible, exactly you lot demand to reckon if this volition potentially hold out a safety lawsuit for you.
Enter SharePoint Online CDN
Office 365 comes alongside a handy CDN capability for SharePoint, in addition to the watch is to expose the SiteAssets library of the sites via the populace CDN endpoint. This way that whatever user tin access the site logo via SharePoint without having explicit rights to the site.
And this is where at that spot could hold out safety concern. If a user knows the mention of an icon inwards SiteAssets of a site he/she does non stimulate got access to, the file tin hold out accessed via the CDN URL. The next file types are past times default exposed via the populace CDN: CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF. I’m no safety expert, exactly I would enjoin the safety run a jeopardy is low.
Once the populace CDN is develop correctly using the steps below, you lot volition hold out able to access a groups logo via the URL: https://publiccdn.sharepointonline.com/tenant.sharepoint.com/teams/mygroupsite/siteassets/__siteicon__.jpg
# SPO management commandlets - https://www.microsoft.com/en-us/download/details.aspx?id=35588 # Connect to your tenant Connect-SPOService https://contoso-admin.sharepoint.com # Enable populace CDN on the tenant Set-SPOTenantCdnEnabled -CdnType Public -Enable $true # Add SiteAssets libraries to the CDN Add-SPOTenantCdnOrigin -OriginUrl */SITEASSETS -CdnType Public
It takes a petty piece earlier the CDN is working, then hold out patient. You tin telephone phone Get-SPOTenantCdnOrigins -CdnType Public, in addition to cheque the status.
You tin too enable CDN using the Office 365 CLI, a cross platform interface for managing unlike aspects of Office 365.
Thanks for reading : Options To Access Logos Of Role 365 Groups Spell Inwards Sharepoint