<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
System Status
Announcements
Announcements
Search
Search
Select Language

Resolving the RDP (401) Unauthorized Error in the Okta MFA Credential Provider

Multi-Factor Authentication

Overview

When attempting to sign in via Remote Desktop Protocol (RDP) using the Okta MFA Credential Provider, users encounter a Multi Factor Authentication Failed message in the UI. The full error appears in the OktaWidget.log as:

 

exception thrown is = System.Net.WebException: The remote server returned an error: (401) Unauthorized.<CR><LF> at System.Net.HttpWebRequest.GetResponse()<CR><LF> at OktaWidget.JwtService.GetStateTokenUsingJwt(String username)<CR><LF> at OktaWidget.OktaWidgetForm..ctor(String username, Int64 parent, Int64 widgetFlow)<CR><LF> at OktaWidget.OktaWidgetClass.displayWidget(Int64 parent, String username, Int64 flow)

 

Multi-Factor authentication Failed message 

Okta Widget Log 

 

Resolving the underlying cause, such as incorrect credentials, misconfigured installation parameters, or authorization issues, corrects the error.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Okta  Multi-Factor Authentication (MFA) Credential Provider
  • Remote Desktop Protocol

Cause

The HTTP 401 (Unauthorized) status code indicates that the request lacks valid authentication credentials for the target resource. Known causes for this error appearing in the OktaWidget.log include:

  • Incorrect username or password
  • Incorrectly entered configuration option (CLIENT_ID, CLIENT_SECRET, or OKTA_URL)
  • Trailing slash included in the URL during installation
  • User not authorized to RDP to the server
  • Duplicate users
  • Skewed time or date

Solution

Correcting an Incorrect Username or Password

Ensure the username and password entered are completely accurate.

 

How Are Incorrect Configuration Options Resolved During Installation?

The values for CLIENT_ID, CLIENT_SECRET, and OKTA_URL can be located and corrected using the steps below. For details on locating the configuration file and understanding each parameter, see How To Locate and Modify The Okta MFA Credential Provider for Windows Agent Configuration File.

Navigate to the Microsoft RDP (MFA) application in Okta:

  1. In the Okta Admin Console, go to Applications > Applications.
  2. Select the Microsoft RDP (MFA) app.

 

Locate or update each parameter:

 

NOTE: When copying the CLIENT_ID or CLIENT_SECRET from a Mac or Linux system into a Windows RDP or Console session, copy and paste can introduce errant characters. To avoid this, open the Okta Admin Console directly from the Windows server and copy the values from within that session. Alternatively, paste into Notepad first, then copy from Notepad into the installer or configuration file.

 

Verifying User Authorization to RDP to the Server

Confirm that Allow remote connections to this computer and Allow connections only from computers running Remote Desktop with Network Level Authentication are enabled in the System Properties dialog.

System Properties dialog showing Remote Desktop settings with Allow remote connections to this computer and Allow connections only from computers running Remote Desktop with Network Level Authentication enabled

Remote Settings panel showing the Remote Desktop configuration options

Confirm the user, or a group the user belongs to, is assigned in Remote Desktop Users, found under the Select Users button.

Remote Desktop Users dialog listing the users assigned to the Remote Desktop Users group

Also confirm the user is assigned to the Microsoft RDP (MFA) app in Okta.

Microsoft RDP app in the Okta Admin Console showing user assignments

 

Identifying and Removing Duplicate Users in Okta

Duplicate users can occur when the same username from multiple domains is imported into Okta. Search for the username in the Okta Admin Console under Directory > People to check for duplicates.

Okta Admin Console People page showing search results with a duplicate user profile entry

If more than one entry exists for the same username, this configuration is unsupported. Examine both entries and remove the duplicate.

 

Correcting a Skewed Time or Date on the Windows Server

The Windows Server system time must be accurate. Ensure Network Time Protocol (NTP) is configured and in sync, or manually adjust the time to the correct value.

 

Recommended content

Loading
Resolving the RDP (401) Unauthorized Error in the Okta MFA Credential Provider | Okta Support