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] ClientContext.IsAppOnly() might fail when authenticated with ClientCredentials #1078

Open
1 of 6 tasks
koskila opened this issue Oct 28, 2024 · 0 comments
Open
1 of 6 tasks

Comments

@koskila
Copy link
Contributor

koskila commented Oct 28, 2024

Reporting an Issue or Missing Feature

There's an issue when you add ClientContext.IsAppOnly() and are using ClientCredentials. It seems to randomly throw an uncaught 403 and crash.

Expected behavior

When calling .IsAppOnly() it should return true or false, not throw (at least not if it is able to fetch the Access Token!)

Actual behavior

When debugging it, I noticed it doesn't happen on first execution of the handler for extracting the AccessToken, but rather on one of the subsequent ones. It's not even actually executing a real query (it's a dummy) but that still fails somehow.

Steps to reproduce behavior

  1. Connect-PnPOnline with ClientCredentials
  2. Call ClientContext.IsAppOnly() in the commandlet's code
  3. Observe

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

Latest dev (f3b8aeffdccc168355d8335ef17d884fd20235b1)

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

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

Next steps

I'll have a fix proposed in a minute.

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

No branches or pull requests

1 participant