Skip to content

[BUG] Get-PnPAccessToken Fails with Custom ResourceUrl #3089

@Studermarc

Description

@Studermarc

Reporting an Issue or Missing Feature

When using Get-PnPAccessToken with a custom ResourceUrl, it fails to retrieve an AccessToken.

Expected behavior

An Access Token is successfully retrieved

Actual behavior

An error occurs: "Get-PnPAccessToken: Object reference not set to an instance of an object."

Steps to reproduce behavior

  • Establish a connection with an Azure AD App having API Permissions provided by another Azure AD App
  • Retrieve Access Token with the established Connection, specify the RessourceURL with the App ID of the API Permissions required.
Get-PnPAccessToken -ResourceUrl "8547a1ea-5b5f-48ef-a668-d27fa4e391d6/.default" -Connection $ProvisioningClientConnection                        

The Following Error gets thrown:
Get-PnPAccessToken: Object reference not set to an instance of an object.

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

2.1.1

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions