Authentication

Mapping external database fields for external database authentication

 
Picture of Vjekoslav Hlede
Mapping external database fields for external database authentication
 

Hi, 

I have successfully utilised Drupal 6 database for external database authentication. Users can log in with their Drupal log in data. 

However I can not get any other data except username and password. They log in and then they have to enter all their data - including name and email. 

Username, password and email are in the 'users' table. 
First and last name are in the 'civicrm_contact' table. 

civicrm_contact->first_name
civicrm_contact->last_name

Is there a way to get data from the civicrm_contact table to the moodle db?

For example, can I somehow put a path to the first_name column in civicrm_contact table in the Data mapping >> First name form field?

Any advice and suggestions will be greatly appreciated!

Thanks,

Vjeko

 
Average of ratings: -
Picture of Lisa Nicholls
Re: Mapping external database fields for external database authentication
 

This is normally easy to do by creating a view on the Drupal database side and mapping to that view rather than to the underlying table(s).  Is this a possibility on your side?

It's best not to try to write back (allow changes to the mapped fields in Moodle and expect them to be back-ported to the remote database) in this scenario.

>L<

 
Average of ratings: Useful (1)
Picture of Vjekoslav Hlede
Re: Mapping external database fields for external database authentication
 

Thanks a lot Lisa,

This is very helpful. 

>> creating a view on the Drupal

The challenge I have now is that Drupal Views do not have option for passwords - or I can not find it. 
Do you know where/how I can get that field in the Views admin interface? Also, are there any security implications? I assume that data should be encrypted by MD5 (hashing)?

Thanks,

Vjeko

 
Average of ratings: -
Picture of Jaswinder Singh
Re: Mapping external database fields for external database authentication
TestersTranslators

Hi Vjeko,

What Lisa wants to say is you need to create a view in your database(drupal db). http://dev.mysql.com/doc/refman/5.0/en/create-view.html

It cant be done via the views module in the drupal site, it has to be done from a toll like phpmyadmin etc.

 
Average of ratings: -
Picture of Antonio Junior
Re: Mapping external database fields for external database authentication
 

Hi Vjekoslav Hlede I am trying to integrate Drupal 7 with Moodle 2.4, in Moodle authentication plugins page I should enter, the details about the database, I am not sure which password field encryption to use, I tried MD5 and SHA1. In both cases I could not login with the credential of Drupal account.

Could share with me the details for this part?

 
Average of ratings: -
Picture of Jaswinder Singh
Re: Mapping external database fields for external database authentication
TestersTranslators

Hi Antonio,

In D6 password encryption is MD5 which is changed to SHA512 with a custom salt in D7. However, to add SHA512 to the Moodle external db auth method, do read this post https://tracker.moodle.org/browse/MDL-21520 (comment posted by ye chen).

For me this method dont work because I cant get rid of the salt. You can either turn off the password salting in D7 but it will make it insecure.

 
Average of ratings: -
Picture of Antonio Junior
Re: Mapping external database fields for external database authentication
 

Hi Jaswinder I followed the link, but the same happen to me I don´t have the same value as the one in Drupal.

One doubt how is this encryption done, by PHP or by the applications?

Thanks for the help

 
Average of ratings: -
Picture of Jaswinder Singh
Re: Mapping external database fields for external database authentication
TestersTranslators

It is based on the Portable PHP password hashing framework.

For more details read : http://api.drupal.org/api/drupal/includes!password.inc/7

 

 
Average of ratings: -