pnp / PnP-PowerShell

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

On ver. "3.26.2010.0", Connect-PnPOnline -Scopes fails with error AADSTS70011 #2983

Open stefanpems opened 3 years ago

stefanpems commented 3 years ago

Reporting an Issue or Missing Feature

Issue

Expected behavior

The command "Connect-PnPOnline -Scopes $arrayOfScopes" works perfectly on the versions of SharePointPnPPowerShellOnline from Sept. 2020 included backward.

Actual behavior

With the Oct. 2020 version (3.26.2010.0), that same command returns the blocking error:

Message: AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope https://graph.microsoft.com/.default https://graph.microsoft.com/Directory.Read.All https://graph.microsoft.com/Group.Read.All https://graph.microsoft.com/Group.ReadWrite.All https://graph.microsoft.com/Reports.Read.All https://graph.microsoft.com/User.ReadWrite.All offline_access openid profile is not valid. .default scope can't be combined with resource-specific scopes.

Steps to reproduce behavior

$arrayOfScopes = @("Group.Read.All","Group.ReadWrite.All","User.ReadWrite.All", "Directory.Read.All","Reports.Read.All") Connect-PnPOnline -Scopes $arrayOfScopes

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

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

The error is only related to the latest version 3.26.2010.0. With 3.25.2009.1 or previous, the error does not appear

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.

stefanpems commented 3 years ago

PS: I get the same error by running the sample code

Connect-PnPOnline -Scopes "Mail.Read","Files.Read","ActivityFeed.Read"

documented in MS Docs:

https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/connect-pnponline?view=sharepoint-ps#------------------example-15------------------

tarjeieo commented 3 years ago

Seeing the same issue with this version. Connect-pnponline -Scopes is broken. Workaround to fall back to an earlier release

stefanpems commented 3 years ago

Yes: => To check if you have the issue, for example use the command: Connect-PnPOnline -Scopes "Mail.Read","Files.Read","ActivityFeed.Read" If you have the issue, you get an error AADSTS70011. If you don't have the issue, you get a login prompt => To check which version is installed use the command: Get-Module -Name sharepointpnppowershell* -ListAvailable => To remove any existing version use the command: Uninstall-Module SharePointPnPPowerShellOnline -AllVersions -Force => To install the previous (last working) version, use the command: Install-Module SharePointPnPPowerShellOnline -RequiredVersion 3.25.2009.1