Sites.Selected delegated permission not working with SPFx web part
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
Windows
What browser(s) / client(s) have you tested
- [ ] 💥 Internet Explorer
- [X] 💥 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
- SPFx v1.18.2
- Node.js v18.18.0
Describe the bug / error
Sites.Selected delegated permission does not work as expected with SPFx web part using Microsoft Graph API to get a SharePoint site.
Steps to reproduce
- Build a SPFx web part to get a specific SharePoint site using the Microsoft Graph API (MSGraphClientV3)
- Deploy the web part requiring Sites.Selected permission:
"webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Sites.Selected" } ] - The site can be retrieved even if no specific permission is granted for the site. All SharePoint sites the user can access can be retrieved from the web part.
Expected behavior
Only sites with specific permission/role can be retrieved from the SPFx web part.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Thank you for taking the time to file an issue. We periodically archive older or inactive issues as part of our issue management process, which automatically closes them once they are archived.
If you’d like to understand more about why and how we handle archived (closed) issues, please see Our approach to closed issues.
We appreciate your contribution and if this is still an active issue with the latest SPFx versions, please do resubmit the details. We needed to perform a cleanup, so that we can start with a clean table with a new process. We apologize for the inconvenience this might cause.