WSO2 Identity server comes with embedded LDAP as a primary user store. But its not recommended to use in production environment. So; you have to use some other products for primary user store(OpenLDAP, AD, JDBC, etc..). You may required some other user store in practical scenarios. So; I'm going to talk about how to create a JDBC user store as a secondary user store with wso2 IS. I'm using wso2 Identity server latest version(current Identity server version is 5.1.0) for this example.
Step 1 :-
Log in to mysql using below command. Lets create a database first.
mysql -u root -proot
Create a database as below.
create database sampledb;
Use newly created database for other operations. use below command.
use sampledb;
Step 2 :-
Then create tables which are required for user store. You can use mysql.sql file which is located in <IS_HOME>/dbscripts/ directory to import tables to newly created database. please use this command
source /home/madura/Documents/wso2/wso2is-5.1.0/dbscripts/mysql.sql
you can see tables creation after execute above command.
You can select the sql script according to your DB.
Step 3 :-
Copy JDBC drive to <IS_HOME>/repository/components/lib directory and start the server
Step 4 :-
Click add user store button and you will get this page
Our primary goal is to create a JDBC user store. So we have to select JDBC user store from drop down menu.
Then you can see the required page and you have to enter below information to create a user store.
Domain Name* : SECONDARY
Description : description about the db. this is not required feild.
Connection URL * : jdbc:mysql://localhost:3306/sampledb
Connection Name * : root
Connection Password * : root
Driver Name * : com.mysql.jdbc.Driver
After provide above details, Click Test Connection button and see whether "Connection is healthy" message is displayed or not. If you get the message, Add connection using Add button.
After you add the connection, you can add users to the user store by selecting user store from the drop down menu as below
Comments
Post a Comment