Configuring SQL Authenticator with Weblogic Server.

Weblogic Server, by default stores the user and group information in an Embedded LDAP Server.

If we want to store the user and group information in a database, Weblogic Server provides an Out of the Box Provider, SQL Authenticator.

The SQL Authenticator uses a default schema, which can be modified.
To create the tables required by the SQL Authenticator using the default schema, execute the following query.

CREATE TABLE USERS (
U_NAME VARCHAR(200) NOT NULL,
U_PASSWORD VARCHAR(50) NOT NULL,
U_DESCRIPTION VARCHAR(1000))
;
ALTER TABLE USERS
ADD CONSTRAINT PK_USERS
PRIMARY KEY (U_NAME)
;
CREATE TABLE GROUPS (
G_NAME VARCHAR(200) NOT NULL,
G_DESCRIPTION VARCHAR(1000) NULL)
;
ALTER TABLE GROUPS
ADD CONSTRAINT PK_GROUPS
PRIMARY KEY (G_NAME)
;
CREATE TABLE GROUPMEMBERS (
G_NAME VARCHAR(200) NOT NULL,
G_MEMBER VARCHAR(200) NOT NULL)
;
ALTER TABLE GROUPMEMBERS
ADD CONSTRAINT PK_GROUPMEMS
PRIMARY KEY (
G_NAME,
G_MEMBER
)
;
ALTER TABLE GROUPMEMBERS
ADD CONSTRAINT FK1_GROUPMEMBERS
FOREIGN KEY ( G_NAME )
REFERENCES GROUPS (G_NAME)
ON DELETE CASCADE

Insert the User and Group records into the database.

insert into USERS (U_NAME,U_PASSWORD,U_DESCRIPTION) values(’system’,’weblogic’,’admin user’);

insert into GROUPS (G_NAME,G_DESCRIPTION) values(‘Adminsitrators’,’Adnministrators’);

insert into GROUPMEMBERS (G_NAME,G_MEMBER) values(‘Administrators’,’system’);

Create a datasource on Weblogic Server.

Create an SQLAuthenticator

myrealm > Providers > new SQLAuthenticator

Under myrealm > Providers > SQLAuthenticator > Provider Specific

Check Plaintext Passwords Enabled
Data Source Name: DS1

Leave the rest as default since we are using default schema.

In my example I have used plain text password.

If you want to log in to the console from users in the database, change the default authenticator flag as OPTIONAL.

Restart the server and log in as system.

Go to myrealm > Users and Groups to see the user and groups from the database.

Latest Comments

  1. Eamonn March 23, 2010
  2. Eamonn March 26, 2010
  3. Arunbaalajee R June 23, 2011
  4. Mark Thompson February 10, 2012
    • Administrator February 21, 2012
  5. Vijay September 11, 2012
    • Administrator September 29, 2012
  6. Vijay September 12, 2012
  7. Gaurav Kaushik October 20, 2014

Leave a Reply