After you create a custom attribute provider API server, you must connect IBM Cloud Pak for Data to the custom attribute
provider.
- 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 Cloud Pak for Data user profile.
Procedure
To connect to your custom attribute provider, complete the following
steps:
- Set the following environment variables:
- Set the
CONFIGMAP_NAME environment variable to the
name you want to use to identify the configuration.
The following example uses the recommended name, cpd-custom-attribute-provider-extension:
export CONFIGMAP_NAME=cpd-custom-attribute-provider-extension
- Set the
API_SERVER_URL environment variable to
the URL of the custom attribute provider:
export API_SERVER_URL=<URL>
- Set the
DISPLAY_NAME environment variable to the
display name you want to use to identify the configuration in the database where Cloud Pak for Data metadata is stored.
export DISPLAY_NAME="Custom Attribute Provider"
-
Create an
attribute_provider extension:
The API server does not require any authentication
cat <<EOF |oc apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
labels:
icpdata_addon: "true"
name: ${CONFIGMAP_NAME}
namespace: ${PROJECT_CPD_INST_OPERANDS}
data:
extensions: |
[
{
"extension_point_id": "attribute_provider",
"extension_name": "custom_attribute_provider"
"display_name": "${DISPLAY_NAME}",
"order_hint": 600,
"details": {
"url": "${API_SERVER_URL}"
}
}
]
EOF
The API server requires a bearer token for authentication
cat <<EOF |oc apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
labels:
icpdata_addon: "true"
name: ${CONFIGMAP_NAME}
namespace: ${PROJECT_CPD_INST_OPERANDS}
data:
extensions: |
[
{
"extension_point_id": "attribute_provider",
"extension_name": "custom_attribute_provider"
"display_name": "${DISPLAY_NAME}",
"order_hint": 600,
"details": {
"url": "${API_SERVER_URL}"
"secretTokenKey": "custom_attribute_provider_token"
}
}
]
EOF
The API server requires a TLS certificate for authentication
cat <<EOF |oc apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
labels:
icpdata_addon: "true"
name: ${CONFIGMAP_NAME}
namespace: ${PROJECT_CPD_INST_OPERANDS}
data:
extensions: |
[
{
"extension_point_id": "attribute_provider",
"extension_name": "custom_attribute_provider"
"display_name": "${DISPLAY_NAME}",
"order_hint": 600,
"details": {
"url": "${API_SERVER_URL}"
"secretCertificateKey": "custom_attribute_provider_certificate"
}
}
]
EOF
The API server requires a bearer token and TLS certificate for
authentication
cat <<EOF |oc apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
labels:
icpdata_addon: "true"
name: ${CONFIGMAP_NAME}
namespace: ${PROJECT_CPD_INST_OPERANDS}
data:
extensions: |
[
{
"extension_point_id": "attribute_provider",
"extension_name": "custom_attribute_provider"
"display_name": "${DISPLAY_NAME}",
"order_hint": 600,
"details": {
"url": "${API_SERVER_URL}"
"secretCertificateKey": "custom_attribute_provider_certificate"
"secretTokenKey": "custom_attribute_provider_token"
}
}
]
EOF
- If your API server requires authentication, set the following environment
variables:
- If your API server requires a bearer token for authentication, set the
BEARER_TOKEN environment variable to the value of the bearer token:
export BEARER_TOKEN=<bearer-token>
- If your API server requires a TLS certificate for authentication, set the
TLS_CERTIFICATE environment variable to the fully qualified name of
the TLS certificate:
export TLS_CERTIFICATE=<fully-qualified-tls-certificate-name>
- Create a secret named
zen-ext-attribute-provider-secret:
The API server does not require any authentication
oc create secret generic zen-ext-attribute-provider-secret \
-n ${PROJECT_CPD_INST_OPERANDS}
The API server requires a bearer token for authentication
oc create secret generic zen-ext-attribute-provider-secret \
-n ${PROJECT_CPD_INST_OPERANDS} \
--from-literal=custom_attribute_provider_token=${BEARER_TOKEN}
The API server requires a TLS certificate for authentication
oc create secret generic zen-ext-attribute-provider-secret \
-n ${PROJECT_CPD_INST_OPERANDS} \
--from-file=custom_attribute_provider_certificate=${TLS_CERTIFICATE}
The API server requires a bearer token and TLS certificate for
authentication
oc create secret generic zen-ext-attribute-provider-secret \
-n ${PROJECT_CPD_INST_OPERANDS} \
--from-literal=custom_attribute_provider_token=${BEARER_TOKEN} \
--from-file=custom_attribute_provider_certificate=${TLS_CERTIFICATE}
What to do next
Now that you've connected IBM Cloud Pak for Data to your custom attribute provider, you're ready to complete Specifying which custom attributes to use in IBM Cloud Pak for Data.