
Welcome to Microsoft Q&A!
As I understand, you've created an Azure AD application and granted it the Sites.Selected API permission in Azure.
You've also configured additional access through the SharePoint Admin Center to allow the app to retrieve data (such as an Excel file) from a SharePoint site—without syncing the file.
However, when attempting to access the file via PowerShell, you're encountering a 403 Forbidden error despite having granted the necessary permissions.
You have checked a thread with similar issues and want to know if:
- Do the solution provided for that thread also work with your condition, without certification required.
- What does error 403 mean.
As I checked, usually error 403 meant your application authentication credential is valid but denied due to lack permissions:
Since all the configurations mentioned in the thread are at the Tenant level, they do require the highest level of admin privileges to implement.
Could you please confirm if you have the necessary permissions—such as SharePoint Admin or Global Admin—to proceed with the setup?
For if solution in the mentioned thread work with your condition:
As I checked, command Set-SPOTenant -DisableCustomAppAuthentication $false does work with client secret, as we also have a similar thread where a User wants their app to access document in SharePoint Online with client secret authentication.
However, while client secrets are currently supported, Microsoft recommends migrating to certificate-based authentication because Azure ACS will be retired in April 2026:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.