This article provides information on how to troubleshoot the following authentication error that occurs when attempting to log in to an Office 365 Okta federated domain using the PowerShell command Connect-MsolService.
An error occurred during authentication. Please retry your operation. If this problem persists, contact Technical Support
- Administrators
- Office 365
- PowerShell
One possible cause of authentication errors when using PowerShell to log in to an Office 365 domain federated with Okta is that TLS 1.2 is not enabled on the PowerShell app.
To enable TLS 1.2 and fix the authentication error, follow the steps below:
- Open PowerShell as an administrator.
- Run the following command in the PowerShell window:
[System.Net.ServicePointManager]::SecurityProtocol =[System.Net.SecurityProtocolType]::Tls12
- Once the command has executed successfully, retry logging in to the Office 365 Okta federated domain using PowerShell
NOTE:
- If TLS1.2 is enabled on PowerShell but still getting the error, check out this Microsoft article, Unable to authenticate your credentials, that discusses some other reasons for the authentication error.
- If running commands in PowerShell continues to be an issue, please open a support case with Microsoft Technical Support.
