Identity Service Management

You can manage a client using the Keycloak administration panel or CLI.

Managing a Client Using the Keycloak Administration Panel

To manage a client, complete the following steps:

  1. Log in to the Keycloak administration panel.
  2. Select the required Realm according to the brand ID.
  3. Go to Clients and perform the required action regarding a client.

Managing a Client Using the CLI

Creating a Client

To create a client, complete the following steps:

  1. On the management node, create a JSON file with IDP client properties. Use the following client JSON template to create a client:

    {
    "name": "psaweb",
    "clientId": "psaweb",
    "baseUrl": "https://cp.us.na.cloud.im",
    "redirectUris": ["https://cp.us.na.cloud.im/*"],
    "clientAuthenticatorType": "client-secret",
    "publicClient": true,
    "protocol": "openid-connect",
    "defaultClientScopes": ["user_account_ids_v1"]
    }

    baseUrl and redirectUris must point to the brand. Use other parameters as is.

  2. Copy this file to the IDP pod. Execute a client creation script on the IDP pod:

    # kubectl cp client.json $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2):/opt/jboss/scripts/
    kubectl exec $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2) -- bash -c "cd scripts && python /opt/jboss/scripts/create_client.py <brand_id>"

Backing Up a Client

  1. Create the get-client-presentation.py script:
  2. Copy this script to the IDP pod:
    # kubectl cp get-client-presentation.py $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2):/opt/jboss/scripts/get-client-presentation.py
  3. Run this script for each brand integrated with PSA:
    # kubectl exec $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2) -- bash -c "cd scripts && python /opt/jboss/scripts/get-client-presentation.py ${brand-id} psaweb" > psaweb-client-brand-${brand-id}.txt

    where:

    ${brand-id}: the internal ID of the brand integrated with PSA.

Deleting a Client

  1. Create the delete-client.py script:

  2. Copy this script to the IDP pod:
    # kubectl cp get-client-presentation.py $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2):/opt/jboss/scripts/get-client-presentation.py
  3. Run this script for each brand integrated with PSA:
    # kubectl exec $(kubectl get pods -o name -l app=idp-backend | cut -d'/' -f 2) -- bash -c "cd scripts && python /opt/jboss/scripts/delete-client.py ${brand-id} psaweb"

    where:

    ${brand-id}: the internal ID of the brand integrated with PSA.