pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
985 stars 665 forks source link

Connect-PnPOnline fails to connect when using federated account #2975

Open tomjan7 opened 3 years ago

tomjan7 commented 3 years ago

Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:

  1. Are you using Apply-PnPProvisioningTemplate or Get-PnPProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

When using Connect-PnpOnline with federated account we get a generic error "Exception has been thrown by the target of an invocation". Review of Azure AD logs indicates an error "Error validating credentials due to invalid username or password" but we can login successfully using browser or if we specify -UseWebLogin parameter with exactly same credentials. Additionally this used to work (last successful attempt on October 6th) but stopped working recently (we first observed the issue on October 19th)

Expected behavior

We expect successful connection without errors

Actual behavior

Exception has been thrown by the target of an invocation - screenshot attached ConnectPnPOnlineFederatedUserError

Steps to reproduce behavior

Execute Connect-PnPOnline with target site URL and specify credentials of federated account

Which version of the PnP-PowerShell Cmdlets are you using?

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

3.19.2003.0

How did you install the PnP-PowerShell Cmdlets?

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.