Main Content

iMIS Authentication Module

iMIS

iMIS authentication module allows a Drupal admin to authenticate users using iMIS with ATS Drupal Web Service. The module would only allow users that exist in the iMIS database, exempted users (via the module's UI) and the “admin” (user 1).

The upgrade pretty much supports all the current features of the D6 version with a few changes and fixes:

• Parsing the response from the service uses SimpleXML

• Fixes for the Administration settings and PHP errors

• Basic tests

Parsing the response from the service uses SimpleXML

Parsing in the D6 version for the response from the ATS Drupal Web Service was manual. I've changed it to SimpleXML since the extension is enabled by default in a PHP installation. I was also able to encounter an issue where parsing messes up the values of the fields that are to be displayed when viewing a user's profile. This happens when the method used is ValidationLogin. The use of SimpleXML fixes this as well.

Fixes for the UI and PHP errors

I've added a fix for the exempted users setting to only allow existing users, and a sanitation of the values for text area types in the admin settings. D6 version doesn't seem to trim the values entered in the text areas thus saving empty values. These empty values messes up the table of the exempted users in the admin settings.

There was also a notice when setting the Host with an invalid URL specifically omitting the “scheme” i.e. http or https. A fix was applied to this as well.

Basic tests

Basic tests were added on the D7 version. Test cases include:

• Logging in for the first time

• Logging in where the account is already saved in Drupal's system

• Logging in with an invalid password

• Logging in an exempted user

• Logging in with Additional user authentication checks

• Checking the validation for saving incorrect settings

• Checking access for user/password depending on the saved settings

A mock up service module is included which simulates the response of the ATS Drupal Web Service

with the ValidateLoginWithData method. SimpleXML is also used to generate the XML response.

Known Issues

ATS Drupal Web Service doesn't seem to provide the Email in its response anymore. I've provided a workaround to allow users to update their email address. This doesn't update the email address in the iMIS database.