Connecting to PnPOnline - Not prompted to login

Respected Contributor

I have a script with Connect-PnPOnline $tenantUrl -UseWebLogin and when I ran it this morning, I was not prompted to login to the tenant. I had not accessed the tenant for over 5 days using powershell. I had logged in using Chrome earlier today. 

Would the PnP cmdlet be using those credentials?

is this expected behavior?


@Erwin van Hunen


1 Reply
best response confirmed by Dean Gross (Respected Contributor)
The last time you logged in with -UseWebLogin, did you by any chance answer yes to the question 'Stay signed in?' If so, yes, that is expected. It's not PnP PowerShell controlling that, it's the combination of browser and cookies (that's effectively what UseWebLogin is doing: it's using an embedded browser)