By: matt dillenkoffer user 29 Jul 2016 at 2:05 p.m. CDT

2 Responses
matt dillenkoffer gravatar
This question is somewhat related to my last question "Displaying custom messages on login form" Is it possible to configure Gluu to automatically add custom attributes to users with some default value when they get created in OpenDJ, say when CachRefresh runs? We need these attributes for our lockout script to work but don't want to have to have someone manually edit each user in Gluu. I would imagine there is a place to put a python intercept script that could do the work when cache refresh runs.... just guessing.

By Mohib Zico staff 29 Jul 2016 at 5:39 p.m. CDT

Mohib Zico gravatar
Hi Matt, >> Is it possible to configure Gluu to automatically add custom attributes to users with some default value when they get created in OpenDJ, say when CachRefresh runs? Yes, it's possible. Here is what you can do: - Create a custom attribute from oxTrust. - Add and populate this attribute with specified values durning Cache Refresh. - Enable this script for Cache Refresh In order to achieve #2 from above, you can utilize Cache Refresh script ( Configuration --> Manage Custom Script --> 'Cache Refresh' tab ) After adding your custom attribute and value in CR script, to enable it.. you need to use 'Update & Validate Script' from Cache Refresh page. Just to give you an example.. let's say we need to add 'company = Gluu Inc' for all users. We can add some quick jython pieces like below in CR script... ``` newAttrCompany = GluuCustomAttribute("company", "Gluu Inc") attributes.add(newAttrCompany) ```

By matt dillenkoffer user 04 Aug 2016 at 12:28 p.m. CDT

matt dillenkoffer gravatar
It seems that when the authorization script tries to set attributes on a user those attributes are created for the user. So I think my question was actually not necessary for this scenario. Thanks for the good info though.