Forum Discussion
Connect-SPOService : Could not authenticate to SharePoint Online
If i install the module to fresh machine, i am getting the login window and i am able to authenticate and connect to SPO, if i logoff from that machine and login using different user, i am not getting the login window and cannot connect to SPO, this behavior is consitent in my envrionment on all machines i tested, i tested with azure ad module for win powershell and cannot reproduce that behavior, i do not have more time to troubleshoot this, so i am happy it can work for me (if i install and use the sp mgmt shell using the same user account), but looks like some bug in the sp mgmt module, if anyone else is experiencing this or has a solution please let me know, thanks
I faced the similar problem.
We do have MFA enabled and for me I got the popup for credentials but did not asked me for MFA code.
below is what I got.
Connect-SPOService : Could not authenticate to SharePoint Online
https://site/ using OAuth 2.0
At line:1 char:1
+ Connect-SPOService https://site/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-SPOService], Authenti
cationException
+ FullyQualifiedErrorId : Microsoft.Online.SharePoint.PowerShell.Authentic
ationException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService
- JoannaAug 03, 2018Copper Contributor
Same issue. We also have MFA.
connect-sposervice =>
connect-sposervice : Could not authenticate to SharePoint Online using OAuth 2.0
- Clinton CherryOct 31, 2018Copper Contributor
I had this issue and realised i was using http rather than https for my sharepoint url.
try changing that.
Also connect using
connect-sposervice -url https://<TenantAdminUrl>.sharepoint.com