RH-SSO with Oracle Back-end Database

Why this article ?

Working with RH-SSO is multiple customers sites raised a very interesting question. “can we deploy RH-SSO on OpenShift with an external DB?”
It took a while but finally the answer to this question is “YES”. from version 7.3 we can create update the current set of files which RH-SSO uses in order to direct it to a different DATABASE

Connect with Environment variables ?

Yes , we can update the connection string so it will expect the connection credentials from the environment variables.

Where to start ?

Create a new project that will store our rh-sso application

Deploy the rh-sso from the Openshift template :

Now let’s delete the postgreSQL database :

Now we need to create our Jdbc extension for Oracle database with environment variables.
We will create the following file in the directory structure :

  1. Download the required JDBC driver for your version of Oracle.
  2. Important: Make sure the file name is “ojdbc7.jar”

Configuration files

First we will create the postconfigure.sh file which is a very simple SHELL command that will be run by the rh-sso in order to connect to the DB :

Next our actions.cli is a simple connection string for ojdbc. We will setup so it will look for environment variables that we are going to provide from the deployment config :

with your favorite editor create the file “extensions/actions.cli” and paste the following content :

The Key environment variable are :


Next we will create a Containerfile that will compile everything together to a single image :

To build the image we are going to use buildah and push it to our internal registry :

First login to registry.redhat.io with your credentials :

Now build the image :

For our final step we need to update the deploymentConfig with the environment variables and our new image. more so any reference to postgreSQL should be removed.

Save and close the deploymentConfig editing mode and Now wait for the rh-sso to start successfully with a connection to the Oracle database.

Open Source contributer for the past 15 years