Forum Discussion
Connect-PnPOnline -UseWebLogin fails, login window disappears
- AnonymousAug 02, 2019Have you tried amending your hosts file?
KenStewart did you ever get this working? I tried, I think, as you said, I turned IPV6 off, I set Google 8.8.8.8 and 8.8.4.4 as my DNS and I logged on to my VPN (I work 100% remote), and all are doing exactly what you are having, my prompt for -UseWebLogin
Connect-PnPOnline -Url $SiteURL -UseWebLogin
Below is a screenshot from a video I took of it. I tried to uninstall and install it again (PNP) as it happens on my user account and on another account that I tried (my admin account).
Just like you, the prompt comes up for a millisecond and then goes away. I have put in my HOSTS file
127.0.0.1 msoid.summitservices.us.com # fix PnP connect problem
and restarted as I tried right after putting that in. I am on a Windows 10 system and I am running PowerShell v5.x as Admin. I tried with PowerShell v7 as well. All the same.
PS C:\WINDOWS\system32> Get-PnPContext RetryCount : 10 Delay : 500 PropertyBag : {} Web : Microsoft.SharePoint.Client.Web Site : Microsoft.SharePoint.Client.Site RequestResources : Microsoft.SharePoint.Client.RequestResources FormDigestHandlingEnabled : True ServerVersion : Url : https://TENANTNAME-admin.sharepoint.com/ ApplicationName : SharePoint PnP PowerShell Library ClientTag : DisableReturnValueCache : True ValidateOnClient : True AuthenticationMode : Default FormsAuthenticationLoginInfo : Credentials : WebRequestExecutorFactory : Microsoft.SharePoint.Client.DefaultWebRequestExecutorFactory PendingRequest : Microsoft.SharePoint.Client.ClientRequest HasPendingRequest : True Tag : RequestTimeout : 180000 StaticObjects : {[SharePointPnP$Settings$ContextCloning, PnP.Framework.Utilities.Context.ClientContextSettings], [Microsoft$SharePoint$SPContext$Current, Microsoft.SharePoint.Client.RequestContext]} ServerSchemaVersion : ServerLibraryVersion : RequestSchemaVersion : 15.0.0.0 TraceCorrelationId : PS C:\WINDOWS\system32>
Matthew Carter I never could get that to work and eventually took a different route using the SharePointOnlinePowerShell module. I was able to connect using an administrative account with Connect-SPOService -Url https://MYDOMAIN-admin.sharepoint.com. This brings up the web-based login window, which stays up.
I've been pressed on other projects since that limited success, so haven't pursued things further. I wanted to supply login credential in a script to avoid interactive logins, but never got that far. Let me know if you have any success along those lines.
- Joshua BinesJan 26, 2021Iron Contributor
KenStewart I was having a similar issue but I deleted all the temp files and cookies in IE and then it started up. Hope it helps!
- AlbatrossCafeFeb 23, 2022Copper Contributor
Joshua Bines I will also say that clearing IE cache forced the login window to pop up again
- KenStewartJan 26, 2021Brass Contributor
Joshua Bines thanks for the reply. That was one of my first steps based on earlier advice from another forum. It's plausible that the underlying code uses some of the old IE engine, or perhaps some of it's local data repository, but that didn't help in my case.