<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
Cannot Confirm or Import Active Directory User in Okta Due to Email Format
Okta Classic Engine
Directories
Okta Identity Engine
Overview

Confirming or importing an Active Directory (AD) user to Okta fails when the email address contains leading or trailing whitespace. To resolve this issue, remove the whitespace from the email address in Active Directory and reattempt the import.

 

The failure occurs despite the email address appearing in the standard <user@domain.com> format. Okta generates one of the following errors:

 

Email should be properly formatted,

 

or

 

email field failed validation with value 'user@domain.com ': Does not match required pattern.

 

Active directory

Applies To
  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Directories
  • Active Directory (AD)
Cause

There is a leading or trailing whitespace before or after the email address in Active Directory. Okta generates the following event in the System Log:

 

Create okta user

FAILURE:

 

Expanding the event reveals the following validation errors:

 

login field failed validation with value ' user@domain.com': Username must be in the form of an email address.<br/>email field failed validation with value ' user@domain.com': Does not match required pattern.<br/>

 

If the user already exists, Okta displays the following error:

 

ErrorCode: doesNotMatchPattern

 

System log

Solution

How is the email format error resolved?

 

To resolve the email format error, remove any leading or trailing spaces from the user's email address in Active Directory and reattempt the import process as described in the video or steps below.

 

 

  1. Reset the user email address in Active Directory to ensure there are no spaces before or after the email address.
  2. Reattempt the import in Okta.

 

Related References

Loading
Cannot Confirm or Import Active Directory User in Okta Due to Email Format