By: Dominique Petitpierre user 24 May 2017 at 10:03 a.m. CDT

2 Responses
Dominique Petitpierre gravatar
Hello, - How can one transform an attribute value with the Gluu server tools? For example in our test setting Cache Refresh is configured to provision people entries in the internal local LDAP Gluu directory with attributes from our organization directory, using attribute name mapping. One of these attribute maps to the local "gender" attribute but contains a numerical value (0, 1, 2, or 9, cf. https://en.wikipedia.org/wiki/ISO/IEC_5218). In the standard openId Connect claims specification the values for the corresponding claim should be "male" or "female". cf. http://openid.net/specs/openid-connect-core-1_0.html#rfc.section.5.1 Of course the conversion ( 0 -> "", 1 -> "male", 2 -> "female", 9 -> "") could be done outside but I would like to know what are the possibilities for such transformations within the Gluu server tools, e.g during synchronization (Cache Refresh, SCIM, file import) or even dynamically when using the local attribute value as the source for a claim. I know that Shibboleth has such extensive on the fly attribute transformation capabilities but I am interested in the context of OIDC. - Is there any documentation or examples that describe such attribute value transformations? - Any other suggestions? Thanks in advance for your pointers and suggestions!

By Mohib Zico staff 24 May 2017 at 10:41 a.m. CDT

Mohib Zico gravatar
I think you can use [Cache Refresh Interception Script](https://gluu.org/docs/ce/3.0.1/admin-guide/custom-script/#cache-refresh) for this. Here is how it will work: - backend Org directory attribute 'gender' --> Gluu Server ldap attribute 'gender' [ this will map exact value ] - Run interception script: - Interception script will have conditions like: - If value == '0' then insert 'male' as attribute in 'gender' and save the value in Gluu Server ldap - else if value == '1' then insert 'female' as attribute in 'gender' etc.

By Dominique Petitpierre user 24 May 2017 at 11:46 a.m. CDT

Dominique Petitpierre gravatar
Thanks! That's what I was looking for.