external db authentication failing

external db authentication failing

by Mairsile Hourihane -
Number of replies: 2

We are having a problem with the external database authentication plug-in.

We can connect from our Moodle 2.9.4 (build 20160111) site to one of our test sites with no problem but when we connect to the live external site the username/password are being rejected. The Moodle site database is mysql (5.5.47-0ubuntu0.12.04.1-log).

The live external site is using Salted Crypt passwords and is using a MSSQL database, so initially we had problems with the field types on the test setting page.  The view on the live external site database is now set to convert the fields to varchar to match mdl_user and the test settings page is now working.  But the authentication is failing.

There is no option to change the encoding to UTF8 at the SQL end; we have tried using the encoding and sql setup string settings on the moodle side, both with Unicode and UCS-2, but neither option worked. 

Is there something in particular we should setting for the view, or maybe settings that we should be using? 

Or are we down to making changes to the select statements at the moodle authentication end? And if we are, what changes should we make.

Attachment cc_ext_db_amweb_settings_unicode.PNG
Average of ratings: -
In reply to Mairsile Hourihane

Re: external db authentication failing

by Mairsile Hourihane -

We've got one step further ... by sticking with the default UTF8 encoding we can now log in.

But it is not pulling the user details from the external database, so at first log in we are being brought to the edit profile page (user/edit.php?course=1&id=18) with blank firstname, lastname and email fields.

If I put data into these and save, I get "Error updating user record." and am returned to the edit profile page not matter what navigation I tries.

The user has been created, but with blank entries in these fields.

In reply to Mairsile Hourihane

Re: external db authentication failing

by Mairsile Hourihane -

It turns out to have been a simple problem.

The field names on view on the external database had changed so once the data mapping was corrected all worked as expected.