A Configuring KeyCloak as Identity Provider for UIM, ATA, and Message Bus

This chapter helps you with information on configuring KeyCloak as an Identity Provider for UIM, ATA, and Message Bus.

For more information on ATA and Message Bus, see "About Unified Inventory and Topology" in Unified Inventory and Topology Deployment Guide.

Prerequisites for Configuring KeyCloak

The following prerequisites are required for configuring KeyCloak:

  • Install KeyCloak.
  • Download all artifacts required to deploy all UIM, ATA and Message Bus.

Creating a New Realm

To create a new realm:

  1. Provide a name for the realm. For example IdentityGuard.
  2. Set Enabled.
  3. Click Create.

    A new realm is created.

Downloading the Identity Provider Metadata File

To download the Identity Provider metadata file:

  1. Switch to the realm you created.
  2. Go to Realm Settings.
  3. Click SAML 2.0 Identity Provider Metadata.
  4. Save the file at a desired location.

Creating a UIM Cloud Native Instance

Follow the instructions mentioned in the "Configuring SSO using SAML 2.0 for UIM CN" section from UIM Cloud Native Deployment Guide.

Create a UIM cloud native instance as follows:

  1. Build UIM CN images using the above downloaded IdP metadata file.
  2. Create UIM CN instance. You can provide a SAML entityId of your choice and the same will be used by the KeyCloak SAML client. For example: samlUIM.
  3. Publish UIM CN Metadata file as KeyCloak supports SAML client creation using Service Providers Metadata file.

For more information on creating a UIM cloud native instance, see "Overview of the UIM Cloud Native Deployment" in UIM Cloud Native Deployment Guide.

Creating a SAML Client for UIM

To create a SAML client for UIM:

  1. Log in to KeyCloak and switch to your realm.
  2. Click on the Clients tab.
  3. Choose the import client option and add UIMCNMetadata.xml (the SP metadata file) to resource file.
  4. Client ID is automatically selected from SP metadata file. It is the same as provided in the project.yaml of UIM CNTK.
  5. Turn off the Client Signature Required flag.
  6. Click Save and verify the client configuration.
  7. If SSL is enabled, add UIM certificates to JAVA_HOME of KeyCloak.

Creating a SAML Client Role

To create a SAML client role:

  1. Log into KeyCloak and switch to your realm.
  2. Click on the Clients tab.
  3. Click on the client you have created above.
  4. Click Roles.
  5. Create a role with the name uim-users.

Adding Role Mapper in SAML Client Scope

To add role mapper in SAML client scope:

  1. Log into KeyCloak and switch to your realm.
  2. Click on the Clients tab.
  3. Click on the client you have created above.
  4. Click Client Scopes.
  5. Under the Mappers tab, add the role list mapper by clicking Add Mapper under the clientId-dedicated scope.
  6. Provide Groups as Role attribute name.
  7. Enable Single Role Attribute.
  8. Under the Scope tab, enable Full scope allowed.

Configuring Session Timeouts

To configure the SSO session timeout:

  1. Log in to KeyCloak and switch to your realm.
  2. Click Realm Settings under Configure.
  3. Navigate to the Sessions tab and set SSO Session Idle to a value less than the WebLogic application timeout value. The default WebLogic application timeout is 30 minutes.

Adding Users and Mapping the Users to the SAML Client Role

To add users and map them to the SAML client role:

  1. Log in to KeyCloak and switch to your realm.
  2. Click on the Users tab.
  3. Click Add User to create users in keycloak.
  4. Add UIM Embedded LDAP and External LDAP users.
  5. Map the users to the SAML client role as follows:
    1. Click on the user you created, under the Users tab.
    2. Click Role Mapping and then Assing Role.
    3. Switch to filter by clients and search for the uim-users role.
    4. Select the uim-users role and click Assign.

Creating OAUTH Client for ATA and Message Bus

To create OAUTH client for ATA and Message Bus:

  1. Log in to KeyCloak and switch to your realm.
  2. Click on the Clients tab.
  3. Click Create Client.
  4. Choose client type as OpenID Connect.
  5. Provide client id of your choice. For example: topologyOauthClient.
  6. Click Next.
  7. Enable client Authentication and select Standard Flow, Direct access grants, and Service accounts roles.
  8. Click Next.
  9. Add the following Valid redirect URIs :
    • https://<unified-topology-hostname>:<loadbalancer-port>/topology
    • https://<unified-topology-hostname>:<loadbalancer-port>/redirect/ata-ui
    • https://<instance>.<project>.uniauth.<hostSuffix>:<loadbalancer-port>/topology
  10. Add https://<topology-hostname>:<loadbalancer-port>/apps/ata-ui as Valid post logout redirect URIs.
  11. Click Save and verify the client configuration.

Configuring the Client Scope and Audience

To configure the client scope and audience:

  1. Log in to KeyCloak and switch to your realm.
  2. Click Client Scopes.
  3. Click Create Client Scope.
  4. Provide the name as ataScope.
  5. Enter the protocol as OpenID Connect.
  6. Enable the Include in token scope.
  7. Click Save.
  8. Go to Mappers and then configure a New Mapper.
  9. Choose the Mapper type as Audience.
  10. Provide a Name and Included Custom Audience as ataAudience.
  11. Enable Add to access token.
  12. Click Save.

Adding Scope to the Client

To add scope to the client:

  1. Log in to KeyCloak and switch to your realm.
  2. Click on the Clients tab.
  3. Click on your OIDC client. For example: topologyOauthClient.
  4. Open the Client Scope tab.
  5. Modify AssignedType of microprofile-jwt from Optional to Default.
  6. Choose the above created Scope (ataScope) by clicking Add Client Scope .
  7. Click Save.

Creating Realm Roles and Assigning the Roles to the Authorized Users

You create realm roles and assign them to the users with Authorization enabled.

Creating Realm Roles

To create realm roles:

  1. Log in to KeyCloak and switch to your realm.
  2. Open the Realm Roles tab.
  3. Click Create Role.
  4. Provide the required role name. For information on the roles, see "About Authentication".
  5. Click Save.
  6. (Optional) Follow steps 3, 4 and 5 above to add another role.

Mapping Realm Roles to the Authorized Users

To map the created realm roles to the authorized users:

  1. Open the Users tab.
  2. Select the user that needs a corresponding role to be assigned.
  3. Click Role Mapping and then Assign Role.
  4. Search for and select the required role. For more information on the roles, see "About Authentication".
  5. Click Assign.

Getting OpenID Endpoint Configurations

To get OpenID endpoint configurations:

  1. Log in to KeyCloak and switch to your realm.
  2. Click on the realm settings.
  3. Click OpenID Endpoint Configuration.

    The OpenID endpoint configurations appear.

Configuring Message Bus and ATA with OAUTH Client

To configure Message Bus and ATA with OAUTH client:

  1. Create the oauthConfig secret.

    Note:

    See "Enabling Authentication for ATA and Messaging Bus" from Unified Inventory and Topology Deployment Guide, for more information.
  2. Create aapUIUser secret and aapUser Secret for topology UI and API.

    Note:

    See "Create Secrets for ATA UI Authentication" and "Create Secrets for Authentication on Unified Topology API" in Unified Inventory and Topology Deployment Guide for more information.
  3. Add openid as an additional base scope in the topology-ui-user-credentials.yaml and topology-user-credentials.yaml files. For example, the base scope must be as follows:
    base-scope: “ataScope openid” 
  4. Use the client ID and client secret of topologyOauthClient for the above steps and for all endpoint URLs.

    Note:

    See Getting OpenID Endpoint Configurations for more information.

Integrating UIM with ATA and Message bus

To integrate UIM with ATA and Message bus:

  1. See "Integrating UIM with ATA and Message Bus" in Unified Inventory and Topology Deployment Guide and use the appropriate values configured through KeyCloak IDP.

    The sample properties for KeyCloak IdentiyGaurd Realm are as follows:

    Client Id : topologyOauthClient
    Client Secret: xxxxxxxxxxxxxxx
    Client scope: ataScope
    Client Audience: ataAudience
    

    Note:

    These are OpenID connect values.
  2. Use the endpoint URLs mentioned in your realm. See "Getting OpenID Endpoint Configurations" for more information.