I can't get modActiveDirectory to authenticate, I've tested the user credentials against the AD with an LDAP browser & can authenticate like that, however, I get these errors in the modx logs:
[2014-02-10 16:49:47] (WARN @ /modx/index.php) Could not load package metadata for package activedirectory.
[2014-02-10 16:49:47] (INFO @ /modx/index.php) [ActiveDirectory] Could not authenticate user: "user@domain" with password "password".
[2014-02-10 16:49:50] (WARN @ /modx/connectors/system/errorlog.php) Could not load package metadata for package activedirectory.
I'm not sure what the problem is, or how to even troubleshoot it...
- Do the active directory users have to exist in modx before authentication, or will the modActiveDirectory extra create them?
- If I create the user with the same credentials, I don't get the "could not authenticate" error.
- but then is the user authenticating against modx or the active directory??
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
Well after digging through some code: it's definitely supposed to create a user that is not found in modx:
core/components/activedirectory/elements/events/onusernotfound.php:
/* authenticate the user */
if ($madDriver->authenticate($username,$scriptProperties['password'])) {
$modx->log(modX::LOG_LEVEL_INFO,'[ActiveDirectory] Attempting to authenticate user');
$user =& $scriptProperties['user'];
$user = $modx->getObject('modActiveDirectoryUser',array('username' => $username));
if (empty($user)) {
$user = $modx->newObject('modActiveDirectoryUser');
$user->set('username', $username);
$user->set('active',true);
$user->save();
$profile = $modx->newObject('modUserProfile');
$profile->set('internalKey',$user->get('id'));
$profile->save();
$user->Profile =& $profile;
} else {
$user->getOne('Profile');
}
$modx->event->_output = $user;
$modx->event->stopPropagation();
return;
}
$modx->log(modX::LOG_LEVEL_INFO,'[ActiveDirectory] Could not authenticate that user: "'.$username.'" with password "'.$scriptProperties['password'].'".');
Some other digging shows that it is supposed to update a user from the AD as well, if I create the user then it complains about the user not being a member of modActiveDirectoryUser group - even if I create the group and add the user.
Looks like a long night ahead
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
-
☆ A M B ☆
- 24,524 Posts
From the looks of those error messages, MODX isn't able to properly load activedirectory in the first place, so the rest of the script can't work.
Sean,
Did you set these settings? See attachment.
Regards,
Tom
This was a stupid mistake on my part. [well not completely me] Something was bugging me while looking at the 'Could not authenticate user: "user@domain" with password "password".' error. The user name - they gave me the user name as user@domain- no one logs in like that, after removing the @domain everything works just fine. Silly mistake.
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
I see the "Could not load package metadata" errors frequently in most modx sites - one of these days I'll track it down [prolly permissions or something] - works anyway.
Quote from: sottwell at Feb 10, 2014, 10:17 PMFrom the looks of those error messages, MODX isn't able to properly load activedirectory in the first place, so the rest of the script can't work.
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
Hi Sean,
Thanks for letting us know how it turned out.
Regards,
Tom