Pnp-powershell: [BUG] Initialize-PnPPowerShellAuthentication: throws Exception after authentication

Created on 18 Aug 2020  Â·  6Comments  Â·  Source: pnp/PnP-PowerShell

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
bug

Most helpful comment

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

All 6 comments

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

Also fails with SharePointPnPPowerShellOnline 3.24.2008.1

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.

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

When this will be fixed

Regards
Sankarasubramanian Parameswaran
Mobile : 202-597-2969
Email : [email protected]


From: Erwin van Hunen notifications@github.com
Sent: Saturday, August 22, 2020 6:04:00 AM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Parameswaran, Sankarasubramanian SParameswaran@wmata.com; Comment comment@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] [BUG] Initialize-PnPPowerShellAuthentication: throws Exception after authentication (#2853)

CAUTION:This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and have verified the authenticity of the message.

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 a calls.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpnp%2FPnP-PowerShell%2Fissues%2F2853%23issuecomment-678621695&data=02%7C01%7Csparameswaran%40wmata.com%7C0abba1e730df4664f1a808d84682b250%7Cad5836f40d7443cd83c57e69eaa67915%7C0%7C0%7C637336874449692422&sdata=f9gPyg5CaNRq03WEZlyWSyMfy76NFkawPhKbhEF1PlY%3D&reserved=0, or unsubscribehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHGCZI33H7DHRBAK5GUVCHDSB6JZBANCNFSM4QDNSXPQ&data=02%7C01%7Csparameswaran%40wmata.com%7C0abba1e730df4664f1a808d84682b250%7Cad5836f40d7443cd83c57e69eaa67915%7C0%7C0%7C637336874449692422&sdata=ns5%2B5bL8g3HM2CujKoxmqButkU6Bb%2Fn%2Fhu4Df%2F4RDxw%3D&reserved=0.

It is fixed in the Dev branch.

It will be in released to production in the September release which will be in September.

Get Outlook for iOShttps://aka.ms/o0ukef


From: sparameswaran78 notifications@github.com
Sent: Saturday, August 22, 2020 3:00:53 PM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Nigel Price pricen@njpenterprises.com; Comment comment@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] [BUG] Initialize-PnPPowerShellAuthentication: throws Exception after authentication (#2853)

When this will be fixed

Regards
Sankarasubramanian Parameswaran
Mobile : 202-597-2969
Email : [email protected]


From: Erwin van Hunen notifications@github.com
Sent: Saturday, August 22, 2020 6:04:00 AM
To: pnp/PnP-PowerShell PnP-PowerShell@noreply.github.com
Cc: Parameswaran, Sankarasubramanian SParameswaran@wmata.com; Comment comment@noreply.github.com
Subject: Re: [pnp/PnP-PowerShell] [BUG] Initialize-PnPPowerShellAuthentication: throws Exception after authentication (#2853)

CAUTION:This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and have verified the authenticity of the message.

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 a calls.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpnp%2FPnP-PowerShell%2Fissues%2F2853%23issuecomment-678621695&data=02%7C01%7Csparameswaran%40wmata.com%7C0abba1e730df4664f1a808d84682b250%7Cad5836f40d7443cd83c57e69eaa67915%7C0%7C0%7C637336874449692422&sdata=f9gPyg5CaNRq03WEZlyWSyMfy76NFkawPhKbhEF1PlY%3D&reserved=0, or unsubscribehttps://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHGCZI33H7DHRBAK5GUVCHDSB6JZBANCNFSM4QDNSXPQ&data=02%7C01%7Csparameswaran%40wmata.com%7C0abba1e730df4664f1a808d84682b250%7Cad5836f40d7443cd83c57e69eaa67915%7C0%7C0%7C637336874449692422&sdata=ns5%2B5bL8g3HM2CujKoxmqButkU6Bb%2Fn%2Fhu4Df%2F4RDxw%3D&reserved=0.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/pnp/PnP-PowerShell/issues/2853#issuecomment-678644753, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACAXJUCXCDUTHN6H4CBHQMTSB7FRLANCNFSM4QDNSXPQ.

Was this page helpful?
0 / 5 - 0 ratings