CORAL Component documentation: XMLAuthenticationService

Ioannis Papadopoulos

CERN

October 2005


1. Introduction

1.1. Purpose of the component

The XMLAuthenticationService package is a plugin library providing an implementation of the IAuthenticationService interface, based on the parsing of an XML file.

1.2. Repository of the component

:pserver:anonymoys@coral.cvs.cern.ch:/cvs/coral/coral/XMLAuthenticationService

2. XMLAuthenticationService Semantics

The XMLAuthenticationService component ("CORAL/Services/XMLAuthenticationService") provides an implementation of the IAuthenticationService interface which is based on the parsing of an XML input file, from where a list of known connection strings is read. For each connection string a user name and a password are specified in the file.

In addition to the credentials corresponding to the default database role, one may define several roles for a given connection string.

The XML file should have a format like the following:


<connectionlist>

<connection name="technology1://host1/db1">
  <parameter name="user" value="dbuser1" />
  <parameter name="password" value="dbpasswd1" />
</connection>

<connection name="technology2://host2/db2">
  <parameter name="user" value="dbuser2" />
  <parameter name="password" value="dbpasswd2" />

  <role name="writer">
    <parameter name="user" value="dbuser2_writer" />
    <parameter name="password" value="dbpasswd2_writer" />
  </role>

  <role name="updater">
    <parameter name="user" value="dbuser2_updater" />
    <parameter name="password" value="dbpasswd2_updater" />
  </role>

</connection>
.
.
.
</connectionlist>

By default the file name of the authentication file that is read is called authentication.xml. This however can be changed by setting accordingly the value of the component's property named AuthenticationFile.

If the authentication file name does not correspond to an absolute path, the system will try to search it in the current working directory and then in the directories defined in the path environment variable CORAL_AUTH_PATH.

If the authentication file is found in multiple places in the directories specified by CORAL_AUTH_PATH, then repeated entries are not overriden, but the first one found is kept.

3. Implementation specifics

The implementation of the package is based on XercesC for the parsing of the XML file, whose contents are read fully in the memory of the client host.

4. Related components

  • RelationalAccess, is the package where the CORAL abstract interfaces are defined.

  • CoralCommon, is the package where some developer-level interfaces and some common implementation classes are defined.

5. XMLAuthenticationService Reference

5.1. Properties of the "CORAL/Services/XMLAuthenticationService" component

  • AuthenticationFile : defines the name of the XML input file. Default value is authentication.xml

5.2. Environment variables

  • CORAL_AUTH_PATH : a path environment variable, where the XML input file is searched for. The current working directory has always higher priority.