
SharePoint Online offers great flexibility in designing intranets and collaboration platforms through custom SPFx web parts. However, one common issue developers and admins face is that guest users (external users) often can't see or interact with these custom web parts. This can be frustrating, especially when your organization relies on collaboration with external partners, contractors, or clients.
In this post, we’ll explore why this happens and walk through the steps to make your custom web parts accessible to guest users.
Why Guest Users Can’t See Custom Web Parts
Guest users are external accounts invited to your tenant, usually through Azure AD B2B. By default, they have limited permissions and do not have access to certain SharePoint features, especially if the content is tied to:
- Restricted CDN content
- Unapproved tenant-wide solutions
- Scripts or APIs that require elevated privileges
- SPFx solutions not deployed tenant-wide
- Resources hosted in restricted locations (e.g., Azure storage with IP restrictions)
This results in errors like:
- "Something went wrong"
- "Access denied"
-
Or the web part simply not rendering at all.
How to Fix It
Here are the main steps to ensure your SPFx web part works for guest users:
1. Deploy Your SPFx Web Part Tenant-Wide
Ensure your custom web part is deployed tenant-wide via the App Catalog, and the "Make this solution available to all sites in the organization" checkbox is selected. This ensures the web part is trusted and usable on any site, including those with guest access.
2. Enable the Office 365 CDN (Public CDN)
If your web part depends on static assets (images, scripts, styles), make sure you’re using the Office 365 Public CDN or another CDN that supports anonymous or guest access.
Steps to enable CDN:Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
Set-SPOTenantCdnEnabled -CdnType Public -Enable $true
Then add your asset library as an origin:
Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl "*/YOURASSETLIBRARY"
3. Use SharePoint Framework (SPFx) v1.11+
Later SPFx versions have improved support for guest and external user scenarios. If you're using an older version, consider upgrading your solution to SPFx v1.11 or higher.
4. Grant Permission to the Guest Users
To ensure guest users can properly load and use custom web parts, follow these steps:
-
Run the following PowerShell script to enable visibility of all user claims (including guest users):
Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
Set-SPOTenant -ShowAllUsersClaim $true
This setting allows SharePoint to correctly recognize "All Users (membership)" in permission assignments.
- Go to your App Catalog site and share it with “All Users (membership)” (which includes guest users who are members of your tenant).
- Assign Read permission to this group.
- This ensures that guest users can access the scripts, components, and assets loaded from the App Catalog.
- Ensure guest users have at least Read access to the actual site where the custom web part is added.
5. Check for External Sharing Settings
In SharePoint Admin Center:
- Go to Policies > Sharing
- Ensure external sharing is allowed at both tenant and site levels.
- Avoid using “Only people in your organization” if you want to support guests.
Wrapping Up
While SharePoint Online supports external users quite well, custom web parts introduce a layer of complexity. The key is to ensure your solutions are deployed tenant-wide, use guest-accessible CDNs, and your sites are correctly configured for external sharing.
Once everything is in place, guest users will be able to fully interact with your custom web parts—unlocking true collaboration across organizational boundaries.