Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.

How to implement InterBase as a back end for BES BasicLoginModule

How to implement InterBase as a back end for BES BasicLoginModule

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

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 20:05
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.