Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

[BUG] Initialize-PnPPowerShellAuthentication: throws Exception after authentication #2853

Closed
2 tasks
WTorremans opened this issue Aug 18, 2020 · 6 comments
Closed
2 tasks
Assignees
Labels

Comments

@WTorremans
Copy link

Reporting an Issue or Missing Feature

I was following the guide Getting started with the SharePoint modernization scanner (https://docs.microsoft.com/en-us/sharepoint/dev/transform/modernize-scanner) and I encountered the following issue at the step Using Initialize-PnPPowerShellAuthentication to setup Azure AD App-Only:

Initialize-PnPPowerShellAuthentication : Exception while invoking endpoint https://graph.microsoft.com/beta/applications.
At line:1 char:1

This only occurred when I was using the latest version of the SharePointPnPPowerShellOnline module (3.24.2008.0), when I uninstalled that version and installed a previous version (3.21.2005.1) the issue didn't occur and the app registration was successfull.

Expected behavior

App Registration is successfull.

Actual behavior

Received the following error:

Initialize-PnPPowerShellAuthentication : Exception while invoking endpoint https://graph.microsoft.com/beta/applications.
At line:1 char:1

Steps to reproduce behavior

Failure

  1. Install the latest version of the SharePointPnPPowerShellOnline module (3.24.2008.0)
  2. Run the following line of code (remember to replace the tenant with the tenant where you want to create the app)

Initialize-PnPPowerShellAuthentication -ApplicationName ModernizationScannerAppTest -Tenant contoso.onmicrosoft.com -Scopes "SPO.Sites.FullControl.All","MSGraph.Group.Read.All" -OutPath c:\temp -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)

  1. Authenticate with a Global Admin account of your tenant

Succes

  1. Install the SharePointPnPPowerShellOnline module version 3.21.2005.1
  2. Run the following line of code (remember to replace the tenant with the tenant where you want to create the app)

Initialize-PnPPowerShellAuthentication -ApplicationName ModernizationScannerAppTest -Tenant contoso.onmicrosoft.com -Scopes "SPO.Sites.FullControl.All","MSGraph.Group.Read.All" -OutPath c:\temp -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)

  1. Authenticate with a Global Admin account of your tenant
  2. Wait 60 seconds
  3. Authenticate with a Global Admin account and Approve the permissions.

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

  • PnP PowerShell for SharePoint Online

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

Failure: 3.24.2008.0
Success: 3.21.2005.1

How did you install the PnP-PowerShell Cmdlets?

  • Installed through the PowerShell Gallery with Install-Module
@sparameswaran78
Copy link

we have already installed 3.2.4 and we have received the same error. we are not able to install 3.21.

@NPrice99
Copy link

Also fails with SharePointPnPPowerShellOnline 3.24.2008.1

@erwinvanhunen
Copy link
Member

erwinvanhunen commented Aug 22, 2020

I can confirm this will fail with all versions of PnP PowerShell that have this cmdlet available. The backend API has changed and we have to update our calls.

-- Update: it turned out to be a serialization issue of our payload.

erwinvanhunen added a commit that referenced this issue Aug 22, 2020
@erwinvanhunen
Copy link
Member

It has been fixed in the dev branch and the next release will contain this fix.

@sparameswaran78
Copy link

sparameswaran78 commented Aug 22, 2020 via email

@NPrice99
Copy link

NPrice99 commented Aug 22, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants