<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Authentication Error on Login to Office 365 Using PowerShell
Single Sign-On
Okta Classic Engine
Okta Identity Engine
Overview

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

Applies To
  • Administrators
  • Office 365
  • PowerShell
Cause

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.
Windows PowerShell 

 

Solution

To enable TLS 1.2 and fix the authentication error, follow the steps below:

  1. Open PowerShell as an administrator.
  2. Run the following command in the PowerShell window: 
[System.Net.ServicePointManager]::SecurityProtocol =[System.Net.SecurityProtocolType]::Tls12
  1. 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.


Related References

Loading
Authentication Error on Login to Office 365 Using PowerShell