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] TokenHandling class now verbose logs Graph access token to the console #3350

Closed
1 task done
mbice opened this issue Aug 16, 2023 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@mbice
Copy link

mbice commented Aug 16, 2023

Reporting an Issue or Missing Feature

As of 2.2.0, we have noticed that when deploying a provisioning template, an access token is output to the console (we verbose log by default to help with potential troubleshooting).

cmdlet.WriteVerbose($"Access token acquired: {accessToken}");

Expected behavior

Maybe this was an intentional change, but my expectation would be that no token that could be used to make unauthorized calls is ever output to the console.

Actual behavior

Graph access token is output to the verbose console log.

Steps to reproduce behavior

  1. Use Invoke-PnPTenantTemplate -Verbose to deploy a tenant provisioning template
  2. See access token logged to the console

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

2.2.0

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

  • Windows
@mbice mbice added the bug Something isn't working label Aug 16, 2023
ryder-cayden pushed a commit to ryder-cayden/powershell that referenced this issue Aug 17, 2023
@KoenZomers
Copy link
Collaborator

Fair concern @mbice. It was a deliberate change as it is of huge help when troubleshooting, but I see where you're coming from. Just know that removing it from the verbose output might conceal it a little more, but a cmdlet like 'Get-PnPAccesstoken` or just by looking at the network traffic using i.e. Fiddler will also reveal it. Will proceed with the PR that has been proposed to remove it again from the verbose output to grant your request.

KoenZomers added a commit that referenced this issue Sep 2, 2023
Fix bug #3350 Do not display access token
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

No branches or pull requests

2 participants