Permission & Access Issues

How to Test SharePoint API Access with Sites.Selected Permission

Kushani NimanthikaKushani Nimanthika Oct 21, 2026 868 views

Question details

The user needs to verify and troubleshoot SharePoint API access using PowerShell because API requests are failing despite having the Sites.Selected application permission and specific site read access.

How to Test SharePoint API Access with Sites.Selected Permission
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Testing API connectivity and verifying access to a specific SharePoint site via an Azure AD application.
Observed behavior
API requests fail with access errors even though Microsoft Graph Sites.Selected permission and read access were supposedly granted to the application.
Before you start

Ensure you have the latest PnP PowerShell module installed on your system and that you possess SharePoint Administrator privileges to verify site-level permission grants.

Solution 1Recommended

Verify Site Permissions and Test Access via PnP PowerShell

Use PnP PowerShell to explicitly check if the Azure AD application has been granted the correct role on the specific SharePoint site, and then attempt a test connection.

The Sites.Selected permission requires a two-step configuration: granting the scope in Azure AD and explicitly granting access to the target SharePoint site via the Microsoft Graph API. Missing the second step is the most common reason for access failures.

1
Connect to the target SharePoint site

Open PowerShell and run 'Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/yoursite -Interactive' to authenticate as an administrator.

2
Verify application site permissions

Execute 'Get-PnPAzureADAppSitePermission' to list all applications with access to this specific site. Verify that your Azure AD App ID is listed with the 'read' role.

3
Grant permissions if missing

If your app is not listed, use 'Grant-PnPAzureADAppSitePermission -AppId <Your-App-ID> -DisplayName "Your App Name" -Permissions Read' to assign the correct permissions.

4
Test authentication using Client ID and Secret

Disconnect, then try to reconnect using your app credentials: 'Connect-PnPOnline -Url https://yourtenant.sharepoint.com/sites/yoursite -ClientId <App-ID> -ClientSecret <Secret>'. If successful, your Sites.Selected permission is working correctly.

Verify Site Permissions and Test Access via PnP PowerShell
Permission Propagation Delay: After granting site-specific permissions, it may take a few minutes for the changes to propagate across Microsoft 365. Wait at least 5 minutes before testing the API connection.
Free Microsoft Office alternative

Experience Lightweight and Compatible Document Management with WPS Office

While resolving complex SharePoint and Azure AD API configurations requires specific Microsoft administrative tools, managing your daily documents shouldn't be complicated. WPS Office provides a free, lightweight, and powerful alternative to Microsoft Office. It seamlessly opens Word, Excel, and PowerPoint files without the heavy overhead.

  1. 1. Download the installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install the software: Run the lightweight installer and follow the on-screen prompts to set up the suite on your device.
  3. 3. Open your documents: Launch WPS Office and directly open your existing Microsoft Office files with perfect formatting preservation.
Completely free to download and use for everyday tasksFully compatible with Microsoft Office formats (.docx, .xlsx, .pptx)Lightweight installation that saves system resources and runs smoothlyFamiliar tabbed interface ensures a zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Why does my API request return a 403 Forbidden error with Sites.Selected?

This typically occurs because the Azure AD app was granted the Sites.Selected scope, but explicit permissions (like Read or Write) were never assigned to the specific SharePoint site using the Graph API or PnP PowerShell.

Can I configure Sites.Selected permissions directly through the SharePoint web interface?

No. Currently, assigning permissions to specific sites for an application using the Sites.Selected scope can only be done programmatically via the Microsoft Graph API or by using PowerShell modules like PnP PowerShell.

What is the primary difference between Sites.Read.All and Sites.Selected?

Sites.Read.All grants the application read access to every single SharePoint site within the entire Microsoft 365 tenant. Sites.Selected provides no access by default until an administrator explicitly grants the application access to specific individual sites, providing a much higher level of security.