Forum Discussion
SharePoint Multi-geo: accessing a user's home-geo custom SharePoint properties from a different geo
Setup
- M365 tenant, multi-geo (NAM + EMEA). SharePoint custom user profile properties are synced only in the user’s home geo (their Preferred Data Location).
- SPFx webparts running on the NAM tenant, using PnP/SP or AadTokenProvider.
- Goal: when an EMEA user opens a NAM page, read their SharePoint custom properties from the EMEA tenant.
Issue 1 — Can’t read profile properties from a different geo-tenant
What I’m doing
const sp = spfi(emeaTenantUrl).using(SPFx(webpartContext), SPFxToken(webpartContext));
const result = await sp.profiles.getPropertiesFor(basicInfo.data.LoginName);Error
Access Denied: This application does not have the required permissions to access profile information.
The core problem — token is missing my approved scopes
Approved Scopes in webApiPermissionManagement (Office 365 SharePoint Online) in SharePoint Admin Center: Sites.Search.All, AllProfiles.Manage, User.Read, User.Read.All, Files.ReadWrite.All, TermStore.ReadWrite.All, Sites.ReadWrite.All, Sites.FullControl.All.
Token issued for the SharePoint resource only contains: Files.ReadWrite.All, M365BillingPlatform.Read.All, Sites.FullControl.All, Sites.ReadWrite.All, TermStore.ReadWrite.All.
So AllProfiles.Manage, User.Read.All, Sites.Search.All are not in the token and an unexpected M365BillingPlatform.Read.All is.
Also tried calling the SharePoint REST API directly with a token from AadTokenProvider → same Access Denied.
Questions
- Why is the issued token missing my approved scopes (and where is M365BillingPlatform.Read.All coming from)?
- Is there a supported way to read a user’s SharePoint profile custom properties from a different geo-tenant from an SPFx webpart?
Approved Scopes in Admin center
Issue 2 — Search query template {User.*} properties not resolving cross-geo
What I’m doing
A SharePoint Search query in the webpart uses a query template that pulls custom user properties dynamically:
{|owstaxidmetadataalltagsinfo:{User.customProperty1}} OR {|owstaxidmetadataalltagsinfo:{User.customProperty2}}The SP object is created the same way as in Issue 1.
What’s not working
When an EMEA user loads the webpart on the NAM tenant, the {User.*} tokens don’t resolve — the query modification shows the static property name itself instead of the user’s values from EMEA.
Question
How do I get the query template to resolve {User.customProperty} using the user’s home-geo (EMEA) profile values?