pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
987 stars 665 forks source link

Connect-PnPOnline Works, requests not (401) #2906

Closed Macro21 closed 3 years ago

Macro21 commented 3 years ago

Reporting an Issue

I try use PnP PowerShell Online with app context in new tenant but get error. In all my old tenant it works.

Actual behavior

image

Steps to reproduce behavior

1- Register SharePoint App: First step 2- Connect-PnPOnline with ClientId/ClientSecret 3- Do the same in a new tenant 4- Check this in old tenant

Which version of the PnP-PowerShell Cmdlets are you using?

What is the version of the Cmdlet module you are running?

SharePointPnPPowerShellOnline 3.25.2009.1

How did you install the PnP-PowerShell Cmdlets?

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Gunther1972 commented 3 years ago

Same issue here on a new tenant (2020-09-08). Both site collection permissions and tenant permissions will fail. No issue with new client id's and new site collections on existing tenants.

proce commented 3 years ago

Morning @Macro21 / @Gunther1972 ,

We had been experiencing the same issue for the past week. We stumble upon this yesterday: https://stackoverflow.com/a/64041259

Connect-SPOService -Url https://####-admin.sharepoint.com
Set-SPOTenant -DisableCustomAppAuthentication $false

Ensure you are on the latest (v16.0.20414.12000) Microsoft.Online.SharePoint.PowerShell otherwise the above Set-SPOTenant command will fail.

This resolved the issue for us on our new tenants.

It looks like this is something that was introduced at the start of the month:

Can you let me know if this also resolved the issues you both were experiencing?

Gunther1972 commented 3 years ago

Hi @proce ,

Thanks a lot! You saved my day. Works like a charm.

Regards,

Günther

Macro21 commented 3 years ago

Hi @proce ,

Seems to work.

Thanks :)