pnp / pnpframework

PnP Framework is a .NET library targeting Microsoft 365 containing the PnP Provisioning engine and a ton of other useful extensions
https://pnp.github.io/pnpframework/
MIT License
201 stars 140 forks source link

Get-PnPSiteTemplate: GetAccessTokenAsync() called without an ACS token generator #929

Open MSFT-klpinhac opened 9 months ago

MSFT-klpinhac commented 9 months ago

I'm using PowerShell 7.3.8 with PnP.PowerShell-Module 2.2.0 and i'm facing the error below when i try to get a provisioning-template that includes Lists ( i have tried multiple lists, including custom lists and Event-lists, but the error is always the same ). Using Set-PnPTraceLog did not help, as the file created is empty.

PS C:\Temp> Get-PnPSiteTemplate -Out c:\temp\template.xml -ListsToExtract "15d8a18d-b27b-4a80-9555-3e521b8216c3" -handlers Lists

Get-PnPSiteTemplate: GetAccessTokenAsync() called without an ACS token generator. Specify in AuthenticationManager constructor the authentication parameters
Haiqi-Wu commented 8 months ago

Same problem. I found this:https://techcommunity.microsoft.com/t5/sharepoint-developer/get-pnpsitetemplate-attempted-to-perform-an-unauthorized/m-p/2631095 It seems that this problem is caused by the way we use to connect-pnponline. But my company is using SharePoint Online operated by 21v in China, I can only connect-pnponline with -useweblogin. How to fix it?

CodingSinceThe80s commented 6 months ago

Same issue here as reported by parent with 2.2.0, but using european tenant with -UseWebLogin (-Interactive does not work as it results in 401 unauthorized).