Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 of 6 tasks
Studermarc opened this issue May 5, 2023 · 2 comments · Fixed by #3091
Closed
1 of 6 tasks

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

Studermarc opened this issue May 5, 2023 · 2 comments · Fixed by #3091
Assignees
Labels
bug Something isn't working

Comments

@Studermarc
Copy link
Contributor

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
@Studermarc Studermarc added the bug Something isn't working label May 5, 2023
@gautamdsheth gautamdsheth self-assigned this May 5, 2023
gautamdsheth pushed a commit to gautamdsheth/powershell that referenced this issue May 5, 2023
gautamdsheth added a commit that referenced this issue May 5, 2023
* Feature: additional params to Set-PnPTenantSite and Set-PnPSite cmdlet

* Fix #3089: issue with retrieving access token for specified resource URL

* Update CHANGELOG.md

---------

Co-authored-by: Gautam Sheth <[email protected]>
@gautamdsheth
Copy link
Collaborator

Yikes, was a nasty regression !
Fixed it, will be available in tomorrow's nightly.
Thanks for pointing it out.

@Studermarc
Copy link
Contributor Author

Awesome. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants