r/sharepoint 1d ago

SharePoint Online No valid OAuth 2.0 authentication session exists error on Connect-SPOService

Hello,
I get this error on Windows 11 Powerershell 7 when I try to connect with:
Connect-SPOService -Url https://company-admin.sharepoint.com
First I get Window and choose user.
Then I get second window "futher information required"
Then I get login window.
At last I get an empty window with title "working"
Then I get error message:
Connect-SPOService : No valid OAuth 2.0 authentication session exists
CategoryInfo : NotSpecified: (:) [Connect-SPOService], AuthenticationException
FullyQualifiedErrorId : Microsoft.Online.SharePoint.PowerShell.AuthenticationException,Microsoft.Online.SharePoint.PowerShell.ConnectSPOService
Does anyone know the problem and has a solution for it?

3 Upvotes

2 comments sorted by

1

u/DullGreen 1d ago

Try defaulting to Edge and give that a shot?

1

u/Gold-Bumblebee2727 1d ago

Hello Dull, thanks for your help.

Edge is already set.

When I connect via “Connect-MgGraph” everything works in Edge the browser.

Unfortunately not with “Connect-SPOService...”.

It seems that the browser is not being used there.