Skip to main content

How to implement InterBase as a back end for BES BasicLoginModule

  • February 16, 2013
  • 0 replies
  • 0 views

Problem

  • Product: Borland Enterprise Server Appserver Edition
  • Product Version: 5.2
  • JDK Version: 1.4.1
  • Platform: Windows, Solaris, Linux

I want to use InterBase to store my usernames and passwords for the BES BasicLoginModule but when I try to create a new schema in my InterBase database using userdbadmin, I get a SQLException:

UserdbAdminTool:

Could not create database schema[interclient][interbase]

Dynamic SQL Error[interclient][interbase]

SQL error code = -104[interclient][interbase]Token unknown - line 1, char 52[interclient][interbase]password

Resolution

The problem is that userdbadmin tries to create a column called PASSWORD in the user table. This is a reserved word in InterBase's SQL Dialect 1. This can be worked around as follows:

1. Manually create the tables using the following script (Note that the password field is now called BESPASSWORD:

SET SQL DIALECT 3;

/* CREATE DATABASE "C:\\ibdata\\basicauthn\\USERS.GDB" PAGE_SIZE 4096 DEFAULT CHARACTER SET */

/* Table: BESUSERGROUPTABLE, Owner: SYSDBA */

CREATE TABLE "BESUSERGROUPTABLE" ( "USERNAME" VARCHAR(35), "GROUPNAME" VARCHAR(35));/* Table: BESUSERTABLE, Owner: SYSDBA */CREATE TABLE "BESUSERTABLE" ( "USERNAME" VARCHAR(50), "BESPASSWORD" BLOB SUB_TYPE 0 SEGMENT SIZE 80);

These are all of the default table and column names except for the password field, which we can override in the realm's config file. With this setup the only thing you can't do is test the password within userdbadmin.

 

2. If you want to run the standard security examples you can now use userdbadmin to do this:

I populated the user table with the sample users and groups:

userdbadmin -db jdbc:interbase://localhost/c:\\ibdata\\basicauthn\\users.gdb -driver interbase.interclient.Driver -interactive

Enter User Name: sysdba

Enter Database Password: : masterkey

Enter "quit" to quit.

> adduser admin admin

> adduser jeeves jeeves

> adduser pclare pclare

> adduser borland borland

> adduser joeshopper joeshopper

> addgroups user

> addgroups associate

> addgroups client

> joingroups admin user

> joingroups jeeves user

> joingroups jeeves associate

> joingroups borland user

> joingroups joeshopper client

> quit

 

3. Because we changed the password field, we need to reflect this in our realm configuration file:

myrealm {

com.borland.security.provider.authn.BasicLoginModule required

DRIVER=interbase.interclient.Driver

URL="jdbc:interbase://localhost/c:\\\\ibdata\\\\basicauthn\\\\users.gdb"

TYPE=BASIC

LOGINUSERID=sysdba

LOGINPASSWORD=masterkey

PASSWORDFIELD=BESPASSWORD;

};

Old KB# 26534

#BasicLoginModule
#Interbase
#Couldnotcreatedatabaseschema
#BES
#SQLException
#VisiBroker
#Security
#UserdbAdminTool