Drupalauth Questions

63 views
Skip to first unread message

Lance Mitchell

unread,
May 12, 2011, 10:48:42 AM5/12/11
to drupalauth
I really need to get your advice on drupalAuth.

I am currently trying to integrate Drupalauth into our Drupal 6.x
installation.

(1) Was it written for 6.x or 7.x?
I am finding alot of errors with the login() method within /drupalauth/
lib/Auth/Source/UserPass.php
The call to Drupal 6.x core function user_authenticate() dies
spectaculary becuase the the Drupal enviroment is not setup.
I have included the drupal files "/includes/database.inc", '/includes/
bootstrap.inc', and '/modules/user/user.module' but the system stll
does not initialize properly when db_set_active() is called.
So thats why I'm wondering which Drupal system/version Drupalauth was
tested on?

(2) How would you use Drupalauth to configure simplesamlphp to dreate
the Drupal instance as a SP along with already hooking into it as a
authentication source IdP?

I am going to use your answers, as I feel you are more expert in
Drupal/SAML
to figure out my next -step strategy for getting it working.

Ben McOsker || Schoolyard

unread,
Jun 20, 2012, 4:14:10 PM6/20/12
to drupa...@googlegroups.com, ja...@schoolyard.com, vl...@inresonance.com
Lance,

I am having the same issues.  Currently running Drupalauth with a Drupal 6.x installation.  On drupal-auth authentication from SimpleSAML I am logging the following errors:

SimpleSAML_Error_Error: UNHANDLEDEXCEPTION

Backtrace:
0 /var/simplesamlphp/www/module.php:180 (N/A)
Caused by: Exception: Could not resolve 'drupalauth:UserPass': No class named 'sspmod_drupalauth_Auth_Source_UserPass'.
Backtrace:
6 /var/simplesamlphp/lib/SimpleSAML/Module.php:124 (SimpleSAML_Module::resolveClass)
5 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:208 (SimpleSAML_Auth_Source::parseAuthSource)
4 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:248 (SimpleSAML_Auth_Source::getById)
3 /var/simplesamlphp/lib/SimpleSAML/Auth/Default.php:52 (SimpleSAML_Auth_Default::initLogin)
2 /var/simplesamlphp/lib/SimpleSAML/Auth/Simple.php:137 (SimpleSAML_Auth_Simple::login)
1 /var/simplesamlphp/modules/core/www/authenticate.php:45 (require)
0 /var/simplesamlphp/www/module.php:135 (N/A)
Also having the same problem finding the Drupal installation using the bootstrap.inc and database.inc includes. 

I am trying to set Drupal running on the same server as a SP and use that authentication for an external IdP authentication. Also wondering if Drupal 7.x would be a better environment to move this authorization forward.  I am using the SimpleSAMLphp authentication module in Drupal to connect to the SimpleSAML installation.  

Also looking forward to any answers on this as there is so little documentation.  My efforts are going to focus on class sspmod_drupalauth_Auth_Source_UserPass extends sspmod_core_Auth_UserPassBase in UserPass.php in the drupalauth module. If I can get the Drupal path working I can then see if a uid is being passed successfully.

Thanks
Ben McOsker
Schoolyard

Ben McOsker || Schoolyard

unread,
Jun 20, 2012, 4:21:11 PM6/20/12
to drupa...@googlegroups.com, ja...@schoolyard.com, vl...@inresonance.com
Also generating a
Missing default-enable or default-disable file for the module drupalauth
in the logs, though I have added an  ENABLE from shell.

Ben McOsker || Schoolyard

unread,
Jun 21, 2012, 1:49:40 PM6/21/12
to drupa...@googlegroups.com, ja...@schoolyard.com, vl...@inresonance.com
I enabled the Core module as the sspmod_core_Auth_UserPassBase class which sspmod_drupalauth_Auth_Source_UserPass is extended from is the only reference in SAML.  I have to use "ENABLE" not "default-enable" to get drupalauth to be recognized.

When I ENABLE the Core module it gives me a message " The module Core was either not found, or wasn't enabled ", though returning it to "default-enable" restores drupalauth functionality, though the sspmod_core_Auth_UserPassBase class is still not recognized.

Not sure if this adds any more background on this.

Ben

Steve Moitozo II

unread,
Jun 22, 2012, 12:53:40 AM6/22/12
to drupa...@googlegroups.com
Hi Ben. Sorry for the delayed response. I've been traveling a bunch lately. 

The module was developed for Drupal 7. Somewhere in my e-mail I have a patch that might work to add support for Drupal 6. I'll be traveling for the next couple of days but I could work on Drupal 6 support next week if you can't use Drupal 7.

If you can use Drupal 7 there is nothing special to do to it. See the installation notes: http://code.google.com/p/drupalauth/wiki/INSTALLATION


On Thursday, May 12, 2011 10:48:42 AM UTC-4, Lance Mitchell wrote:

Steve Moitozo II

unread,
Jun 22, 2012, 1:00:49 AM6/22/12
to drupa...@googlegroups.com
Ben,

I found Lance's modified UserPass.php. Try this with Drupal 6 and you should be in business. If you can confirm that everything works for you then I'll do a thorough review and create a Drupal 6 branch based on Lance's version. Hope this helps.


On Thursday, May 12, 2011 10:48:42 AM UTC-4, Lance Mitchell wrote:
UserPass.php

Ben McOsker

unread,
Jun 22, 2012, 9:40:08 AM6/22/12
to drupa...@googlegroups.com, ja...@schoolyard.com, vl...@inresonance.com
Steve,

Thanks for your response.  I have implemented the UserPass.php that was attached and receive the same errors:
This from the system logs:
un 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] Missing default-enable or default-disable file for the module drupalauth
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] SimpleSAML_Error_Error: UNHANDLEDEXCEPTION
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] Backtrace:
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 0 /var/simplesamlphp/www/module.php:180 (N/A)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] Caused by: Exception: Could not resolve 'drupalauth:UserPass': No class named 'sspmod_drupalauth_Auth_Source_UserPass'.
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] Backtrace:
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 6 /var/simplesamlphp/lib/SimpleSAML/Module.php:124 (SimpleSAML_Module::resolveClass)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 5 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:208 (SimpleSAML_Auth_Source::parseAuthSource)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 4 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:248 (SimpleSAML_Auth_Source::getById)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 3 /var/simplesamlphp/lib/SimpleSAML/Auth/Default.php:52 (SimpleSAML_Auth_Default::initLogin)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 2 /var/simplesamlphp/lib/SimpleSAML/Auth/Simple.php:137 (SimpleSAML_Auth_Simple::login)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 1 /var/simplesamlphp/modules/core/www/authenticate.php:45 (require)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] 0 /var/simplesamlphp/www/module.php:135 (N/A)
Jun 22 09:29:53 node2 simplesamlphp[2222]: 3 [fdcf4a785c] Error report with id c4683660 generated.
Jun 22 09:30:02 node2 kernel: hrtimer: interrupt took 15990090 ns

this from the SimpleSAML panel:

SimpleSAML_Error_Error: UNHANDLEDEXCEPTION

Backtrace:
0 /var/simplesamlphp/www/module.php:180 (N/A)
Caused by: Exception: Could not resolve 'drupalauth:UserPass': No class named 'sspmod_drupalauth_Auth_Source_UserPass'.
Backtrace:
6 /var/simplesamlphp/lib/SimpleSAML/Module.php:124 (SimpleSAML_Module::resolveClass)
5 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:208 (SimpleSAML_Auth_Source::parseAuthSource)
4 /var/simplesamlphp/lib/SimpleSAML/Auth/Source.php:248 (SimpleSAML_Auth_Source::getById)
3 /var/simplesamlphp/lib/SimpleSAML/Auth/Default.php:52 (SimpleSAML_Auth_Default::initLogin)
2 /var/simplesamlphp/lib/SimpleSAML/Auth/Simple.php:137 (SimpleSAML_Auth_Simple::login)
1 /var/simplesamlphp/modules/core/www/authenticate.php:45 (require)
0 /var/simplesamlphp/www/module.php:135 (N/A)

I have attached my authsources file. The "Missing default-enable or default-disable file for the module drupalauth" error is something I can't resolve as I have tried "ENABLE" and "default-enable" values.

The error seems to be it is not finding the Drupal installation.  I have tried a number of different strategies to push this to the class.  The Drupal root is itself part of the Drupal API, correct?

Thanks for your attention in this.

Best,
Ben McOsker

authsources.php

Ben McOsker || Schoolyard

unread,
Jun 25, 2012, 9:22:54 AM6/25/12
to drupa...@googlegroups.com, ja...@schoolyard.com, vl...@inresonance.com
Steve,

I am now trying to use the Exception declaration in www/module.php to give more meaningful errors:
$state = SimpleSAML_Auth_State::loadExceptionState();

- still not giving any additional information.  It really seems that sspmod_drupalauth_Auth_Source_UserPass is not being loaded (may
be UserPass.php is not loading at all, which I am now trying to force).

Any additional information you may have on Drupal 6 SimpleSAML implementation would be much appreciated.

Best,
Ben McOsker

Steve Moitozo II

unread,
Jun 26, 2012, 12:58:18 PM6/26/12
to drupa...@googlegroups.com
It looks like you didn't enable the module for SimpleSAMLphp. Is the "default-enable" file in  the drupalauth directory? You can create the enable file or default-enable file in the root of the module directory with this command:

touch PATH_TO_SIMPLESAMLPHP/modules/drupalauth/enable

You should have structure like this:

simplesamlphp/
    |----> modules/
        |----> drupalauth/
            |-----> default-enable
            | ----> lib/
                |----> configHelper.php
                |----> Auth/
                    |----> Source
                        |----> UserPass.php
signature.asc
Reply all
Reply to author
Forward
0 new messages