Parse Windows AD canonical name into string array Skip to main content
https://support.okta.com/help/answers?id=9062a000000bmj6qai&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Paul.Bryan ADMIDaaS-BryanPPaul.Bryan ADMIDaaS-BryanP 

Parse Windows AD canonical name into string array

Whats the best way to parse the Windows CN into an Okta String Array as part of the profile import
Gabriel SrokaGabriel Sroka (Okta, Inc.)
Hi Paul
Do you mean the CN or the DN? The CN looks like
cn: Paul Bryan
whereas the DN looks like:
dn: CN=Paul Bryan,OU=Users,DC=example,DC=com

Also, what's your use case? There is no split function (yet)
Gabriel SrokaGabriel Sroka (Okta, Inc.)
A few more thoughts:
1. CN stands for Common Name (not Canonical). There is another attribute called canonicalName that looks like:
canonicalName: example.com/Users/Paul Bryan
(for the same user in my earlier reply). This is a multi-value attribute. To get the first one, Okta needs:
Arrays.get(appuser.canonicalName, 0)
2. You might be able to use substringBefore, substringAfter, replace, etc functions to accompllish your goal, see:
http://developer.okta.com/reference/okta_expression_language/index