Symantec Access Management

 View Only
  • 1.  Siteminder get groups with a regex in response

    Posted Apr 13, 2017 11:47 AM

    Hello,

     

    I'm using CA Siteminder and I want to create an REGEX for a response.

     

    What I need to do it's using the SM_USERNESTEDGROUPS attribute get only the groups with a specific string, for that I did this following expressions:

     

    ENUMERATE(SM_USERNESTEDGROUPS,STRING(%0) LIKE 'CN=*THESTRING*'?STRING(%0):'')

    But the output is

     

    CN=aaaaaaaTHESTRING,OU=Applications,OU=GROUPS,DC=DOMAIN,DC=COM^CN=bbbbbbbbTHESTRING,OU=Applications,OU=GROUPS,DC=DOMAIN,DC=COM^CN=ccccccccTHESTRING,OU=Applications,OU=GROUPS,DC=DOMAIN,DC=COM

    But what I need (what my client need in fact) it's just the CN, so the ouput they need is:

     

    CN=aaaaaaaTHESTRING;CN=bbbbbbbbTHESTRING;CN=ccccccccTHESTRING

    Can we do that with a REGEX?

     

    Thanks

     

    Denis



  • 2.  Re: Siteminder get groups with a regex in response



  • 3.  Re: Siteminder get groups with a regex in response

    Posted Apr 17, 2017 04:18 PM

    Hello Santosh,

     

    Thank you for the answer,

     

     

    I finally made it by using this expression:

     

    ENUMERATE(SM_USERNESTEDGROUPS,RDN(STRING(%0),TRUE) LIKE 'CN=*THESTRING*'?RDN(STRING(%0),TRUE):'')

     

    But the output is:

     

    CN=aaaaaaaTHESTRING^CN=bbbbbbbbTHESTRING^CN=ccccccccTHESTRING

     

     

    Do yo know a way to replace the '^' by ';'?

     

    Thanks,



  • 4.  Re: Siteminder get groups with a regex in response

    Posted Apr 18, 2017 04:16 AM

    Hi Denis,

     

    Kindly use below inbuilt function to implement the use case.

     

    TRANSLATE Function--Replace String Value

    The TRANSLATE function replaces all occurrences of one string found within a second string with a third string. The search is case-sensitive unless the optional Boolean is set to TRUE.

    Syntax

    The TRANSLATE function has the following format:

    TRANSLATE(source_string, search_string, replace_string[, not_case_sensitive])

    Parameters

    The TRANSLATE function accepts the following parameters:

    source_string (string)

    search_string (string)

    replace_string (string)

    not_case_sensitive (Boolean)

    (Optional) If this parameter is not set or set to FALSE, case is considered in the search. If set to TRUE, case is ignored.

    Return Value

    The TRANSLATE function returns a string.

    Example

    Return_value=TRANSLATE('Eric','r','x')
    Return_value='Exic'

    Return_value=TRANSLATE('Eric','ri','x')
    Return_value='Exc'

    Return_value=TRANSLATE('Eric','r','xy')
    Return_value='Exyic'

    Return_value=TRANSLATE('Eric','R','x')
    Return_value='Eric'

    Return_value=TRANSLATE('Eric','R','x',TRUE)
    Return_value= 'Exic'

     

    Like below:

    Return_value=TRANSLATE('CN=aaaaaaaTHESTRING^CN=bbbbbbbbTHESTRING^CN=ccccccccTHESTRING','^',';')
    Return_value='CN=aaaaaaaTHESTRING;CN=bbbbbbbbTHESTRING;CN=ccccccccTHESTRING'

     

    Thanks,

    Sharan