403 Forbidden
error typically occurs because the request to SharePoint does not have sufficient authentication or permissions to access the resource. System.User.AccessToken
variable is enabled in your flow or app. To enable this: Open the HTTP action in Power Automate. Under Settings (gear icon), enable the Secure Inputs and Outputs option. Ensure the connection is authenticated with Azure AD.If System.User.AccessToken
is not available, you can retrieve an access token manually using the following steps:
Create an Azure AD App Registration: Go to Azure Portal → App Registrations → New Registration. Provide a name, and under Supported account types, select "Accounts in this organizational directory only." Note the Application (Client) ID and Directory (Tenant) ID.
Assign API Permissions: Go to the app's API permissions. Add permissions for SharePoint (Sites.Read.All
, Sites.Manage.All
, or other relevant permissions). Grant admin consent.
Generate a Client Secret: Go to the app's Certificates & Secrets. Create a new client secret and note the secret value.
Obtain the Access Token: Use the following HTTP request in Power Automate or a custom script to get the access token.
Authorization
header of your SharePoint request: Authorization: Bearer {Access-Token}