1.9 Single Sign On

1.9 Single Sign On

by steven dauncey -
Number of replies: 10

Hi all,

I have successfully installed moodle 1.9 and set up an ldap connection, I am now trying to implement the ntlm single sign on however when i click the 'login' link i get a page saying "attempting Single Sign On...." but i also get a windows authentification box!

Has anyone else had this problem? can anyone help?

Thanks.

Steven

Average of ratings: -
In reply to steven dauncey

Re: 1.9 Single Sign On

by Dan Stoll -
Yeah I get this. But only when I first goto the site.. I place in here my AD user info and password, and it fails, but so does the single sign on.. If I try it again without closing the browser it doesn't come back with the pop up,, just tries SSO, but without any luck..  Does your fail as well.. I feel like I'm nearly there,, but it just will not let me authenticate with AD..
In reply to Dan Stoll

Re: 1.9 Single Sign On

by steven dauncey -

That is exactly what im getting, i've had a look at the php files in the ldap dir in moodle but not being an expert i cannot see anything obviously wrong. i've tried lowering browser security setting but to no avail. i get the same results in both IE and firefox.  If you find a solution please let me know.

Thanks

Steven

In reply to steven dauncey

Re: 1.9 Single Sign On

by steven dauncey -

SUCCESS!!

The windows authentication box pops up due to the browser not recognising the moodle site as part of the local intranet!

In 'tools'-'internet options'-'security tab', select 'local intranet' then click the 'sites' button, choose the 'advanced' option and add the url of the moodle site.

(This is saved to the profile)

Visit the moodle site and test.

In reply to steven dauncey

Re: 1.9 Single Sign On

by Steve Lee -
Steven is right. Also note that if you are on a network behind a proxy you need to put an exemption in to not go through the proxy server.
In reply to Steve Lee

Re: 1.9 Single Sign On

by estevan veenstra -

Hello All, I'm nearly there too,

I have succeede in integrating the moodle-google integration in my moodle. One last step is needed.

All blocks are installed, certificates work, redirecting from google to moodle works, syncing works.

But when I log in to moodle this debbuging error appears with the ominous last line (so disabling automatic redirect). What do I do to enable redirect?:

exception 'blocks_gdata_exception' with message 'User already exists

Debugging Traceback (to hide, turn off debugging):

  • line 96 of auth/gsaml/auth.php: call to blocks_gdata_gapps->moodle_create_user()
  • line 3197 of lib/moodlelib.php: call to auth_plugin_gsaml->user_authenticated_hook()
  • line 128 of login/index.php: call to authenticate_user_login()

' in /hsphere/local/home/chemie/testmoodles2.nl/moodle/blocks/gdata/gapps.php:439 Stack trace: #0 /hsphere/local/home/chemie/testmoodles2.nl/moodle/auth/gsaml/auth.php(96): blocks_gdata_gapps->moodle_create_user(Object(stdClass)) #1 /hsphere/local/home/chemie/testmoodles2.nl/moodle/lib/moodlelib.php(3197): auth_plugin_gsaml->user_authenticated_hook(Object(stdClass), 'admin', '********') #2 /hsphere/local/home/chemie/testmoodles2.nl/moodle/login/index.php(128): authenticate_user_login('admin', '********') #3 {main}

  • line 108 of auth/gsaml/auth.php: call to debugging()
  • line 3197 of lib/moodlelib.php: call to auth_plugin_gsaml->user_authenticated_hook()
  • line 128 of login/index.php: call to authenticate_user_login()
Error output, so disabling automatic redirect.

 Thanx in advance,

 

Estevan Veenstra

In reply to estevan veenstra

Re: 1.9 Single Sign On

by Abed Islam -

I know this is old and what I'm about to say does not answer his question, but I'm leaving this here because it is the highest search result when Googling, "exception 'blocks_gdata_exception' with message 'User already exists"

I'm trying to get the Google Apps integration going with Moodle 2.0.3. I'm new to Moodle, read up on 1.9 but didn't get to do any solid development on it.

I am not sure what kind of flow there would be to add a new user/student and have them sync with Google Apps. At the moment I'm doing it manually (creating test students, Adding User to Sync). When I try to login as the student it doesn't create the user account in Google Accounts as the script halts at the above line of code:

"auth/gsaml/auth.php: call to blocks_gdata_gapps->moodle_create_user()"

That function/method itself is just trying to add the current user to the database of Moodle users to sync with Google but throws an error if the user is already found there. The thing is, at least with the present version of code, we wouldn't even have gotten that far in the script if the user wasn't already added to sync, at the onset of  user_authenticated_hook in auth/gsaml/auth.php:

$record = $DB->get_record('block_gdata_gapps', array('userid' => $user->id));
if (empty($record) || !empty($record->remove)) {
return true;
}

So just wanted to say one step I took to get passed that is just to comment out the line that calls the moodle_create_user method. I am not sure if this is the correct thing to do, but it makes enough sense to me at the moment.

In reply to Abed Islam

Re: 1.9 Single Sign On

by Abed Islam -

Trying to get SSO working with SAML... or rather trying to figure out why it isn't working as advertised. We have other domains/organizations using Apps so we can't leave the SSO enabled redirecting everyone to Moodle. Since noone's in the office I just used our IP in the network mask and then Google's SSO kicks in.......but I get this error:


"Google Apps - This service cannot be accessed because your login request contained invalid recipient information. Please log in and try again.

This service cannot be accessed because your login request contained invalid recipient information. Please log in and try again.


We are unable to process your request at this time, please try again later."

We were getting this because we're trying to integrate Google Apps on an add-on domain, not the primary domain, however if we just switch to our primary domain it works, but we want it to work for the add-on domain. Still working on this. But before that here's an error I came across.

If you've got error messaging turned on (instead of logging) this might be an issue in /auth/gsaml/auth.php in the function user_authenticated_hook

add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID,                             $user->id, 0, $user->id);

You get an error that $USER is undefined. It's assigned on the next line. I just replaced it with this instead:

add_to_log(SITEID, 'user', 'login', 'view.php?id='.$user->id.'&course='.SITEID,                             $user->id, 0, $user->id);

Dunno where else to post stuff since I never put up a developer blog. I'll post back if/when I find solutions for mixing up primary/add-on domain & enabling SSO only for the web host.

In reply to steven dauncey

Re: 1.9 Single Sign On

by J Guzman -

Hello Steven!

I am in looking for information about setting up my ldap. Any suggestions on how to accomplish this??  I have configured the ldpa, but I dont know goung beyond this to test and check its working.

thank you

JMG