pnp / powershell

PnP PowerShell
https://pnp.github.io/powershell
MIT License
679 stars 347 forks source link

[BUG] #3344

Closed calebmil closed 1 year ago

calebmil commented 1 year ago

Notice

Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting -ForceAuthentication flag for Connect-PnpOnline does not use entered credentials for WIA workstations

Expected behavior

As a user in a corporate environment that uses Windows Integrated Authentication (WIA), I need to connect to SharePoint as an admin account or other account that is different from the credentials I used to login to the Windows machine I am using when I run the cmdlet. When I use Connect-PnpOnline -Url $url -Interactive -ForceAuthentication, I expect that I will be prompted for my alternate user name and password and receive a connection back as that alternate account.

Actual behavior

I am correctly prompted for a user name but when I submit it, the login process sees my WIA credential and tries to log me in with that instead. Use cases we have seen this in include:

  1. Logged in to Windows as a non-admin user. Attempt to connect to an SPO site that the non-admin account does not have access to. Enter admin credentials at the login prompt. Receive Access Denied error from SPO event the admin credentials have rights to the site being access.
  2. Logged in to Windows with an account that is not federated to AAD. Attempt to connect to an SPO site. Enter admin credentials at the login prompt. Receive AADSTS50107: The requested federation realm object '' does not exist.

Steps to reproduce behavior

See actual behavior description above for use cases and steps to repro.

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

2.2 (also seen in 2.1)

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

CallumCrowley commented 1 year ago

@calebmil have you tried -UseWebLogin instead of -Interactive?

veronicageek commented 1 year ago

Closing as no response.