SharePoint / SharePoint/sp-dev-docs
Accessing SharePoint user profile properties via REST api (_api/SP.UserProfiles.PeopleManager) in SPFx stopped working as of May 27th @ around 7pm
@Amey-MSFT is already working on this.
Since May 29, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
SharePoint REST API
Developer environment
macOS
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
- Affecting all users in our company
- Various: Edge/Chrome/Safari latest
- SPFx version 1.17.4
- Node.js version 16.20.1
- macOS 15.4.1/Windows 11 etc
Describe the bug / error
There is an internal Microsoft support ticket attached to this.
Retreving a SharePoint user's profile properties via REST ap in SPFx stopped working as of May 27th @ around 7pm. The following code snippet will fail (mildly edited from what I have in code):
this.context.aadTokenProviderFactory.getTokenProvider();
.then(aadTokenProvider => { return aadTokenProvider.getToken(tenantURL) })
.then(token => {
const requestHeaders: Headers = new Headers();
requestHeaders.append("Accept", "application/json;odata=verbose");
requestHeaders.append("Content-type", "application/json;odata=verbose");
requestHeaders.append("Cache-Control", "no-cache");
requestHeaders.append("Authorization", `Bearer ${token}`);
requestHeaders.append('odata-version', '');
return this.context.httpClient.get(tenantURL + "_api/SP.UserProfiles.PeopleManager/getuserprofilepropertyfor(accountname=@v,%20propertyname='propertyname')?@v='i:0#.f|membership|username@userco.com'", HttpClient.configurations.v1, {
headers: requestHeaders
});
})
Note that I use aadTokenProvider and httpClient instead of spHttpClient because that's the only way to access properties in a multi-geo tenant. This was working for both my main domain and my emea domain.
Steps to reproduce
- Place the above code in a newly minted SPFx webpart
- Test the webpart with gulp serve
- Request will fail with Permissions Denied 403 error
Expected behavior
The httpRequest should be successful and return a value for the requested property.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.