<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
0D50Z00008S3baFSAROkta Classic EngineAdministrationAnswered2024-04-16T13:21:43.000Z2018-10-11T01:41:44.000Z2018-10-19T17:10:51.000Z

v86kv (v86kv) asked a question.

Importing AD users with spaces in the username

So I was told by Okta support that they 'don't like' spaces in the username field. I am realizing that AD usernames that have spaces in them are not being assigned in Okta because of this. An example is BSMITH 2@domain.com. I was giving this article to reference: https://developer.okta.com/reference/okta_expression_language/

 

 

 

 

 

And told by support to use the expression below during the AD import process: 

 

 

 

 

 

String.removeSpaces("This is a test")

 

 

 

 

 

I have been working with that and the AD username field and have tried multiple expressions such as: 

 

String.removeSpaces(user.username)

 

String.removeSpaces(user.samaccountname)

 

f:String.removeSpace(user.username)

 

 

 

 

 

And so on. So far I cannot find a working expression to import the user and remove the spaces from the AD username. I can't imagine this is a strange or unique request and there must be other admins that have done this (I hope) successfully. 

 

 

 

 

 

Thank you. 


  • Hi Tim,

     

    Probably this is just a typo, as the username attribute must be typed userName.

    The expression should be as follows: ${f:String.removeSpaces(user.userName)}

     

    I hope this works for you.

     

    Thank You,

     

    Bogdan Popescu

    Technical Support Engineer

    Okta Global Customer Care

     

    Expand Post
    Selected as Best
  • Hi Tim,

     

    Probably this is just a typo, as the username attribute must be typed userName.

    The expression should be as follows: ${f:String.removeSpaces(user.userName)}

     

    I hope this works for you.

     

    Thank You,

     

    Bogdan Popescu

    Technical Support Engineer

    Okta Global Customer Care

     

    Expand Post
    Selected as Best
  • mike.davie1.5312945692819849E12 (Customer First Programs)

    Hello Tim,

     

    Thanks for posting your inquiry in Okta Community Portal.

     

    If you receive a great answer to your question(s), please help readers find it by marking it the best answer. Hover over the answer and click "Best Answer."

     

    Thank you,

    Mike Davie

    Okta Help Center

     

    Expand Post
This question is closed.
Loading
Importing AD users with spaces in the username