Drupal 7 SSO authentication plugin

This forum post has been removed

Number of replies: 15
The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by pallavi srivastava -

hi dave,

pls tell me the steps to integrate moodle 2.3 and drupal7

 

thanks,

pallavi

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Steven Silvern -

This is really great!

And...the sync_users.php requires that the External Database plugin aka "auth_db plugin" be enabled and configured correctly.

Some indication that this is required and a discussion of values for the configurations would be very useful

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Joe Muldoon -

Hi Dave,

Have you tested to see if this plugin does work across multiple domains? I see from the documentation it checks to see if a Drupal cookie exists, will this present an issue of the sites are on different domains?

Thanks,

Joe

In reply to Joe Muldoon

Re: Drupal 7 SSO authentication plugin

by chris porter -

With the way this is designed, there's really no way for this work across multiple domains. In fact, at present, there's really no way to get this to work across multiple subdomains. The documentation was pretty targeted in that it assumes a 'same domain' configuration. The main problem is with the way it determines the name of the session cookie to use.

In about 98% of all cases Drupal generates a session cookie by sha256 hashing the domain, then prepending either SID or SSID depending on wether this is over HTTP or HTTPS respectively. The code gets these values from the moodle drupalservices configuration's "base url" field, it parses the 2 values from the  complete url, and determines the cookie name it should be looking for. If it exists, it makes a backend request with those values to confirm authentication.

The problem lies in the other 2% of cases - the people who SSO their phpsession cookie across multiple subdomains. To do this, in drupal you must set the $cookie_domain variable to have a wildcard domain such as ".example.com" (note the leading "." that indicates anything beneath it). 

When the $cookie_domain variable is set, drupal uses that value as the hashing value for the session name instead of the actual domain. which causes the moodle-drupalservices module to not find sessions at all & thus not authenticate anyone. This is also something that can't be configured for in the moodle settings of the site.

My suggestion for a fix (I'll submit a pull request with my fix later as I'm not sure how actively maintained the module / comment thread here is so we'll see):

Either add a field that accepts the option "name of the session cookie", or accepts the optional "name of the cookie domain". both will be difficult for the average user to figure out, so keeping them optional will capture the majority of scenarios.

Anyhow, hope this helps!

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Victoria M -

Hi everyone,

I'm trying to set up this plugin following the instructions on the wiki.

It works all properly until the users syncronization shell. It seems to retrieve users from Drupal (there is the number of user entries to update) but then it keeps saying: "Error writing to database!". 

I also gave the moodle user database the correct permissions to the drupal database (select and delete) as I read it somewhere in these forums before.

I don't understand what I'm doing wrong. Is there someone that can help me?

Thank you very much.

In reply to Victoria M

Re: Drupal 7 SSO authentication plugin

by Juan Jiménez -

Hi everybody,

 

I am having the same problem. I have a drupal 7.26 installation, and moodle 2.6. I have followed the instructions in:

https://github.com/cannod/moodle-drupalservices/wiki/Installation-Drupal-Side

and

https://github.com/cannod/moodle-drupalservices/wiki/Installation-Moodle-Side

Everything worked out, but the final step, which is the simultaneous login:

I log in to drupal, and then go to moodle but I am not logged in as it should be. Sometimes happens that just clicking in the Log in link in moodle I am actually logged in in moodle.

I cannot really understand it as I am not a developer.

Also I have problems on syncronising the users. The first time I did it, it worked out, but after changing one user name I tried to sync again and gave me your same error:

User entries to update: 2
Updated user admin(1)
!!! Error writing to database !!!

Where can I get some help? Thanks in advance!

edit: I was able to terminate with this error: the problem was that I changed the user name in drupal. Then moodle couldnt manage it.

The problem with the simultaneous login still remains, but can be because of this changing of names. I am going to remake all the installation to see if it works. I will say something here just in case it helps anyone.

In reply to Juan Jiménez

Re: Drupal 7 SSO authentication plugin

by Mariu P -

Hello Juan,

did you solve this with the sso? I have the same problem. A user logged in drupal goes to moodle and needs to click in login to actually be logged in moodle, wich is really confusing for users.

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by jeremy iverson -

Hi-

I followed the instructions for the plugin install and configure on the Drupal side of things with no issues.

On the moodle side, when I got to the Configure Drupal Services portion and saved my changes, I did not get any success / fail messages.

Any clues as to why this might be?

Thanks for any and all help with regard to this.

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Camilo Rivera -
I coulnd't get it working with separeted domains:

* mycampus.com
* mydrupalsite.com

I get the next success/fail messages:

Fail : cookies: SSO Cookie not discovered. 1) check that you are currently logged in to drupal. 2) Check that Drupal's session cookie is configured in settings.php 3) check that cookie_domain is properly filled in.
Fail : system/connect: User session data reachable but you aren't logged in!
Success : user/login: Logged in to drupal!
Success : muser/Index: User listings are active!

I've logged in Drupal with different accounts and I always get the same messages. Maybe I'm doing something wrong?

Anyway, thanks for all the work.
In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Natalia Nogueira -

Hi! I had my moodle site working with moodle-drupal services auth plugin. It worked fine for months, but now I can't log in, I get a blank page. 

Is there a way I can disable de plugin or something? Since I can't login, I can't do anything.

Thank you for any help.

 

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Roberto Martínez -

Hello,


I am trying to connect drupal 7 and moodle 2.8, but I get this errors,


loaded saved session settings config:Array
(
    [host] => http://xx.xxx.xxxx.xxx
    [cookie domain] =>  

)

Notice: Undefined property: stdClass::$cookiedomain in /var/www/html/auth/drupalservices/auth.php


where should I configure $cookiedomain 


Thanks In advance

In reply to Deleted user

Re: Drupal 7 SSO authentication plugin

by Max Paultre -

I also installed the plugin for Moodle 3.0 on the same server as a OpenAtrium 2 on Drupal 7 and having some trouble getting the SSO to work properly.  SSO is an integral feature in our setup, has anyone got it working with Moodle 3 and Drupal 7?  Should we downgrade to an older version of Moodle?

In reply to Max Paultre

Re: Drupal 7 SSO authentication plugin

by Max Paultre -

Quick update.  I was able to get SSO (Drupal Services) working with Moodle 3.0 on OpenAtrium2 (Drupal 7.41) working.  I am currently testing it to make sure everything is working as expected.