Recently I blogged on how to “Invoke SharePoint REST API from Power Automate Desktop”, in the blog we are granting Power Automate Desktop Application access using SharePoint App-Only Authentication.
All worked well for me, however one of my subscribers complained that they are getting the error below –
{"error":"invalid_request","error_description":"Token type is not allowed."}
As a first step of troubleshooting, I requested them to check if they are facing the same problem using a REST Client(Postman) and this confirmed that the problem is not really related to Power Automate Desktop.
On Investigating further, I found that Microsoft has rolled out a change to all SharePoint Online tenants created on or after August 2020 which restricted App-Only Authentication. Tenants created before this time work just fine.
Fortunately the tenant’s behaviour can be changed as follows:
- Make sure the latest version of the SharePoint Online Management Shell is installed. The steps below have been tested using version 16.0.20616.12000. You can verify the currently installed version using the following command:
Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Please note that upgrading an old Management Shell can be problematic. Please see this blog post for more details.
- Launch the ‘SharePoint Online Management Shell’ as Administrator.
- Connect to your environment’s tenant admin URL using the following command.
Connect-SPOService -Url https://tenant-admin.sharepoint.com
Make sure you replace the URL with your tenant name and include the ‘-admin’ suffix. You will be asked to login, please make sure the credentials for a SharePoint admin are specified. (You may need to reach out to your SharePoint Online support team in order to make this change).
- Execute the following command to make the change
Set-SPOTenant -DisableCustomAppAuthentication $false

Please note that it may take 5 minutes for this change to take effect.
Subscribe to this blog for the latest updates about SharePoint Online, Nintex, Microsoft Flow, Power Apps, and document conversion and manipulation.