Install Red Hat Single Sign-On on Red Hat OpenShift.
Outcomes
Install a Red Hat Single Sign-On Operator on OpenShift.
Configure Red Hat Single Sign-On on OpenShift by using custom resource definitions.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start ocp-installsso
Procedure 5.1. Instructions
Log in to your Red Hat OpenShift cluster as the admin user with redhat as the password.
Create the rhsso project.
The web console URL is https://console-openshift-console.apps.ocp4.example.com.
From the workstation machine, navigate to the Red Hat OpenShift web console at https://console-openshift-console.apps.ocp4.example.com.
When prompted, click and log in as the admin user with redhat as the password.
Navigate to → and click . Type rhsso in the field and click .
Using OperatorHub, install the Red Hat Single Sign-On operator in the ocp4.example.com cluster.
Use the rhsso namespace.
Navigate to → and type Single Sign-On in the field.

Click , and then click .
In the drop-down menu, ensure that the rhsso namespace is selected.
Do not change any field. Then, click .
The installation can take a few minutes to complete.

Click to display the page.

Create the keycloak-db-secret secret pointing to the external database.
Navigate to → , and ensure that the rhsso namespace is selected.
Click menu and select the From YAML option. Then, enter manually the following content:
kind: Secret apiVersion: v1 metadata: name:keycloak-db-secretnamespace: rhsso type: Opaque stringData:POSTGRES_DATABASE: keycloakPOSTGRES_EXTERNAL_ADDRESS: sso.lab.example.comPOSTGRES_EXTERNAL_PORT: '5432'POSTGRES_PASSWORD: postgresPOSTGRES_USERNAME: postgres
Click .
Create the do313-keycloak Keycloak custom resource.
Navigate to the → menu, and click .
Click in the block.

The Keycloak resource creation.
On the page, select to display the web console YAML editor.
Update the YAML code as follows and then click .
kind: Keycloak apiVersion: keycloak.org/v1alpha1 metadata: name:do313-keycloaklabels: app: sso namespace: rhsso spec: externalAccess: enabled: trueexternalDatabase:enabled: trueinstances: 1
The do313-keycloak resource shows in the tab. Wait for the to update from to .
It takes 5-10 minutes for the to update from to .
Navigate to → , and click the service.
Ensure that the keycloak-postgresql service is pointing to an external location.

The keycloak-postgresql points to an external location.
Retrieve the credentials from the do313-keycloak keycloak.
Navigate to the → menu, and click . Click tab.
On the page, click to display details of the do313-keycloak resource.
Select the tab, and click secret to retrieve credentials details.
On the page, scroll down to locate and click .

The value shows username admin. Copy the value to use in the log in step.
Log in to the RH-SSO Admin Console.
Navigate to → to display the list of routes for the rhsso project.
Click the route to display the route details. The field provides a link to the Keycloak instance. Click the link to access RH-SSO Admin Console in a new tab.

On the RH-SSO Admin Console, click . Then, log in as the admin user with the password that you retrieved in the preceding step.
Close all the Firefox windows.