Connect-PnPOnline Client Secret Authentication Suddenly Failing with "Unauthorized" – Could This Be Related to ACS Retirement? #5377
Replies: 1 comment
|
Yeah, that lines up exactly with the ACS shutdown. That -ClientId/-ClientSecret combo you're using with Connect-PnPOnline? PnP flags that as the legacy SharePoint ACS app-only auth which basically, the moment you pass in -ClientSecret, routes you through ACS under the hood. And ACS for SharePoint Online has been dead since early april. So no amount of double-checking your secret or permissions is going to fix that 401. It's not a config issue, the whole auth path just doesn't exist anymore. For unattended/automated scenarios, you'll want to switch over to Entra ID app-only auth with a certificate instead: Just make sure the cert's public key is uploaded to the app registration in Entra, and that the app has the right application permissions with admin consent. And if this is running inside Azure somewhere like automation, managed identity is worth considering too like we did. |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We have recently encountered an issue with Connect-PnPOnline when authenticating using Client ID and Client Secret against SharePoint Online.
The connection was previously working, but it now fails with the following error:
Unexpected response from the server. The content type of the response is "". The status code is "Unauthorized".
We have already verified the following:
I would like to seek confirmation whether this could be related to the retirement of Azure ACS (Access Control Services) for SharePoint, it stated fully retired on April 2, 2026.
https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/add-ins-and-azure-acs-retirements-faq
Any guidance would be greatly appreciated.
Thank you.
All reactions