Specifying which custom attributes to use in IBM Software Hub

After you connect IBM Software Hub to your custom attribute provider, you must tell IBM Software Hub which attributes can be used to create dynamic user groups.

Who needs to complete this task?
To complete this task, you must be either:
  • A cluster administrator
  • An instance administrator
When do you need to complete this task?

Complete this task if you want to use a custom attribute provider to automatically append attributes to a user's IBM Software Hub user profile.

Before you begin

Best practice: You can run many of the commands in this task exactly as written if you set up environment variables for your installation. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

Before you can specify which custom attributes to use in IBM Software Hub, you must complete Connecting to your custom attribute provider.

About this task

By default, the attributes-configmap ConfigMap for the instance includes the following attributes:
  • Location
  • Nationality
  • Organization
  • User type

To use additional attributes in dynamic user groups, you must add the attributes to the attributes_dictionary array in the attributes-configmap ConfigMap.

Each attribute must define the following properties:
Property Description
<uniqueID> A unique identifier for the attribute.
displayName The name of the attribute to display in the web client.
attribute_type The type of the attribute.

Only simple attributes are supported. Other attribute types are not supported.

type The data type of the attribute.

Only the string data type is supported. Other data types are not supported.

enabled Whether to display this attribute in the web client.

To use the attribute to create dynamic user groups, you must set this property to true.

path The path to the attribute.
  • If you are adding attributes from your IdP, you must specify the path to the attribute in the Identity Management Service.
  • If you are adding attributes from a custom attribute provider, you must specify the path to the attribute in the custom attribute provider.
The entry must have the following format:
      {
        "<uniqueID>": {
          "displayName": "<Display name>",
          "attribute_type": "simple",
          "type": "data-type",
          "enabled": true,
          "path":"<path-to-the-attribute>"
        },

Procedure

  1. Log in to Red Hat® OpenShift® Container Platform as a user with sufficient permissions to complete the task.
    ${OC_LOGIN}
  2. Edit the attributes-configmap ConfigMap:
    oc edit ConfigMap attributes-configmap \
    --namespace=${PROJECT_CPD_INST_OPERANDS}
  3. Add the attributes to the attributes_dictionary array.

    In the following code, customAttribute1 is a sample custom attribute:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: attributes-configmap
      namespace: PROJECT_CPD_INST_OPERANDS
    data:
      attributes_dictionary: |-
        [
          {
            "location": {
              "displayName": "Location",
              "attribute_type": "simple",
              "type": "string",
              "enabled": true,
              "internal_only": false,
              "path":"location"
            },
            "nationality": {
              "displayName": "Nationality",
              "attribute_type": "simple",
              "type": "string",
              "enabled": true,
              "internal_only": false,
              "path":"nationality"
            },
            "organization": {
              "displayName": "Organization",
              "attribute_type": "simple",
              "type": "string",
              "enabled": true,
              "internal_only": false,
              "path":"organization"
            },
            "userType": {
              "displayName": "User Type",
              "attribute_type": "simple",
              "type": "string",
              "enabled": true,
              "internal_only": false,
              "path":"userType"
            },
            "customAttribute1": {
              "displayName": "Custom Attribute One",
              "attribute_type": "simple",
              "type": "string",
              "enabled": true,
              "path":"customAttribute1"
            }
          }
        ]
  4. Save your changes to the attributes-configmap ConfigMap.
  5. Restart the usermgmt pods for the changes to take effect:
    oc delete pod -n ${PROJECT_CPD_INST_OPERANDS} -l component=usermgmt

What to do next

Now that you've added the custom attributes to the attributes-configmap ConfigMap, you can use the attributes to create dynamic user groups.