Testing WSO2 Identity Server on Oracle Database using docker

Download the Docker image

  1. Sign in to https://hub.docker.com/ using your credentials. (If you don’t have an account yet signup now)
  2. Access the Oracle database docker image from https://hub.docker.com/_/oracle-database-enterprise-edition
  3. Click on “Proceed to Checkout”.
Logs on your terminal when the image is downloaded

Create the docker container

  1. Execute the following command to create an oracle DB server instance named (oracle_db).
docker run --name oracle_db -p 1521:1521 -p 5500:5500 store/oracle/database-enterprise:12.2.0.1

Log on into docker container

  1. Execute the following command. (Change the nameoracle_db if you changed the container name when creating)

Create a new user and grant permission to that user

  1. Before creating the user set “_ORACLE_SCRIPT” param to true, to avoid errors such as ORA-65096: invalid common user or role name
GRANT CREATE SESSION TO admin;
GRANT CREATE TABLE TO admin;
GRANT CREATE TRIGGER TO admin;
GRANT CREATE SEQUENCE TO admin;
GRANT CREATE PROCEDURE TO admin;

Let’s connect the created DB via the Oracle SQL Developer tool

  1. If you haven’t downloaded Oracle SQL developer previously, Download it from https://www.oracle.com/tools/downloads/sqldev-downloads.html and extract the zip.
  2. Execute the sqldeveloper.sh file.
Connection Name — oracle_db (Name can be any name)
Username — admin (Created user's username)
Password — password (Created user's password)
Hostname — localhost
Port — 1521
Service Name — ORCLCDB.localdomain
  • <IS-HOME>/dbscripts/identity/oracle.sql
  • <IS-HOME>/dbscripts/identity/uma/oracle.sql
  • <IS-HOME>/dbscripts/consent/oracle.sql
  • <IS-HOME>/dbscripts/oracle.sql

Setting up the IS with your created Oracle DB.

[database.identity_db]
type = "oracle"
hostname = "localhost"
sid = "ORCLCDB.localdomain"
username = "admin"
password = "password"
port = "1521"
[database.shared_db]
type = "oracle"
hostname = "localhost"
sid = "ORCLCDB.localdomain"
username = "admin"
password = "password"
port = "1521"
[user_store]
type = "database_unique_id"
[database.user]
url = "jdbc:oracle:thin:@localhost:1521/ORCLCDB.localdomain"
username = "admin"
password = "password"
driver = "oracle.jdbc.OracleDriver"
[realm_manager]
data_source = "WSO2USER_DB"

Before starting the Identity Server

  1. Download corresponding JDBC connector. from https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store