AnsweredAssumed Answered

User Attribute Mapping or Expression

Question asked by SamWalker on May 4, 2017
Latest reply on May 5, 2017 by SamWalker

Hello Everyone, Our AD is a combination of multiple domains which is exposed to SM using Global Catalog. I need to populate user's domain information from our Active Directory to send as a variable to back end applications. Unfortunately this info is not populated as an attribute in AD. So we chose to use SM Expressions to strip user information from user's DN.

For ex: , I have the following DN and I need to extract bbr (first value of dc=) into a response variable.

 

CN=Name,OU=objects,OU=loc,OU=COR,OU=what,DC=bbr,DC=cont,DC=where,DC=what,DC=com

 

Step1:

I have used AFTER expression to capture everything after  FIRST 'DC=' by using the following:

 

AFTER(distinguishedName,'dc=',TRUE),

 

policy server populates the result : bbr,DC=ad,DC=comp,DC=com"

 

PS Trace shows: 

[05/04/2017][17:51:36][4044376944][][][][][][][][][][][][][][Evaluated "AFTER(DISTINGUISHEDNAME,{dc=},TRUE)" as string (Type: string, Value: "na,DC=ad,DC=comp,DC=com")][][][XPSEval.cpp:366][12851][17:51:36.816][Evaluate][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

 

Step2: I need to use BEFORE expression on the above output to extract 'bbr' string. So I have used a BEFORE condition on step 1's output as the source string and passed ',' as my parameter. 

 

BEFORE(AFTER(distinguishedName,'dc=',TRUE),',') 

 

However, SM draws a blank at this point and populated response with a blank. Am I making a syntax error somewhere? Can I club AFTER and BEFORE expressions?

Note, I for the BEFORE function to work by itself such as BEFORE(distinguishedName,',',TRUE),',') correctly, but unable to combine the output with another function such as AFTER.

 

Appreciate any help.

Outcomes