You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In SharePointPnPPowerShellOnline, Connect-PnPOnline will return an error 'Token request failed', with exception details available^ .
^ eg, the slightly unwieldy, but possible:
> [System.IO.StreamReader]::new($Error[0].Exception.InnerException.Response.GetResponseStream()).ReadToEnd()
{"error":"invalid_client","error_description":"AADSTS7000222: The provided client secret keys for app 'xxx' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds.\r\nTrace ID: xxxx\r\nCorrelation ID: yyy\r\nTimestamp: 2023-02-14 08:32:27Z","error_codes":[7000222],"timestamp":"2023-02-14 08:32:27Z","trace_id":"xxx","correlation_id":"yyy","error_uri":"https://accounts.accesscontrol.windows.net/error?code=7000222"}
Actual behavior
In PnP.PowerShell version 1.12.0, Get-PnPList (and others) will return "Exception has been thrown by the target of an invocation." with no information about what the actual problem is.
I guess I can understand getting the access token "lazily" (on the first cmdlet that requires it), but not including any details of the error makes it really difficult to debug problems
The text was updated successfully, but these errors were encountered:
I also ran in to this issue, however I was unable to get the "slightly unwieldy, but possible" output to work. Probably because it may vary depending on the call made.
After extending the expiry date of my secret I no longer get those ambiguous errors.
Background: My client secret has expired.
Expected behavior
In
SharePointPnPPowerShellOnline
,Connect-PnPOnline
will return an error 'Token request failed', with exception details available^ .^ eg, the slightly unwieldy, but possible:
Actual behavior
In
PnP.PowerShell
version 1.12.0,Get-PnPList
(and others) will return "Exception has been thrown by the target of an invocation." with no information about what the actual problem is.Steps to reproduce behavior
Platform
I guess I can understand getting the access token "lazily" (on the first cmdlet that requires it), but not including any details of the error makes it really difficult to debug problems
The text was updated successfully, but these errors were encountered: