Modify or trim an attribute value with expression
search cancel

Modify or trim an attribute value with expression

book

Article ID: 376678

calendar_today

Updated On:

Products

CA Single Sign On Agents (SiteMinder) CA Single Sign On Federation (SiteMinder) CA Single Sign On Secure Proxy Server (SiteMinder) SITEMINDER

Issue/Introduction

An LDAP attribute mail has the following raw value: [email protected].

How can it be trimmed to a result string value: example123usergmailcom, by removing all the special characters?

One of the federation application requires this.

Environment

ALL SiteMinder version and Platform.

Cause

Custom built expression is required.

LTRIM or RTRIM function eliminates spaces, but not actual character.

Resolution

1. Define additional user attribute mapping list under SiteMinder directory properties using active expression:

modifiedemail (Expression):     TRANSLATE(mail,'@','')                       //removing @ sign from mail attribute

modifiedemail2 (Expression):   TRANSLATE(modifiedemail,'-','')        //removing - sign from modifiedemail

2. Define agent response in a protected domain.

WebAgent-HTTP-Header-Variable    mymail=<%userattr="modifiedemail" %>
WebAgent-HTTP-Header-Variable    mymail2=<%userattr="modifiedemail2" %>

3. Test result after user authorization.

0> id 224, len 023 : 'businesscategory=active' - '61 63 74 69 76 65 '
1> id 224, len 031 : 'mymail2=example_123usergmail.com' - '61 76 69 6e 61 73 68 5f 31 32 33 6e 65 77 67 6d 61 69 6c 2e 63 6f 6d '
3> id 224, len 031 : 'mymail=example_123-usergmail.com' - '61 76 69 6e 61 73 68 5f 31 32 33 2d 6e 65 77 67 6d 61 69 6c 2e 63 6f 6d '
4> id 224, len 008 : 'cn=example' - '75 73 65 72 31 '

Noticed that mymail2 is still NOT the complete result as wished for yet, but it did remove both @ and - character.

One will have to create more additional user attribute mapping, until ALL the known special chars are removed from string.

Due to recursive modification of the same attribute, this expression implementation needs to pass performance testing in QA first before go live.

Alternatively, develop a custom assertion plugin, to modify the email address attribute in real time as appropriate.

Additional Information