Class 'SimpleSAML_Auth_Simple' not found

3,648 views
Skip to first unread message

Thomas Leidinger

unread,
Jun 9, 2010, 10:12:46 AM6/9/10
to simple...@googlegroups.com
Hi,

I have what I guess is a newbie question.

I successfully installed and configured SimpleSAML to integrate with
german universities. Now I only want to initialize SimpleSAML on my
PHP-page like you describe it here:
http://simplesamlphp.org/docs/1.6/simplesamlphp-sp

Unfortunatly I keep on getting this error:
Fatal error: Class 'SimpleSAML_Auth_Simple' not found in xxx

Does anybody of you maybe know this error?
I would appreciate any help.

Thanks,
Thomas

Olav Morken

unread,
Jun 10, 2010, 1:43:31 AM6/10/10
to simple...@googlegroups.com

Have you remembered to register the simpleSAMLphp classes with the
PHP autoloader?

require_once('<path to simplesamlphp>/lib/_autoload.php');

If you don't load this file, PHP will not be able to locate the classes.

--
Olav Morken
UNINETT / Feide

Thomas Leidinger

unread,
Jun 10, 2010, 2:21:40 AM6/10/10
to simple...@googlegroups.com
Yes.

At the moment my code looks like this:

require_once('/var/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');

I also tried to include the lib-path to my php.ini.


2010/6/10 Olav Morken <olav....@uninett.no>:

Olav Morken

unread,
Jun 10, 2010, 7:05:34 AM6/10/10
to simple...@googlegroups.com
On Thu, Jun 10, 2010 at 08:21:40 +0200, Thomas Leidinger wrote:
> Yes.
>
> At the moment my code looks like this:
>
> require_once('/var/simplesamlphp/lib/_autoload.php');
> $as = new SimpleSAML_Auth_Simple('default-sp');
>
> I also tried to include the lib-path to my php.ini.

Which version of simpleSAMLphp are you running? Could you check that
the file «/var/simplesamlphp/lib/SimpleSAML/Auth/Simple.php» exists?

Thomas Leidinger

unread,
Jun 10, 2010, 7:24:08 AM6/10/10
to simple...@googlegroups.com
I'm running version 1.6.
Yes the file exists at that location.


2010/6/10 Olav Morken <olav....@uninett.no>:

Olav Morken

unread,
Jun 10, 2010, 8:15:28 AM6/10/10
to simple...@googlegroups.com
On Thu, Jun 10, 2010 at 13:24:08 +0200, Thomas Leidinger wrote:
> I'm running version 1.6.
> Yes the file exists at that location.

The only contents in your file is:

<?php


require_once('/var/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');

And the error occurs on the «$as = new ...»-line? It doesn't occur
while loading a session or anything like that?

Thomas Leidinger

unread,
Jun 10, 2010, 9:52:28 AM6/10/10
to simple...@googlegroups.com
I'm really sorry. You gave the right hint. The code was included in a
Session-based system. As a standalone-php-site it works fine

Thanks for the hint

2010/6/10 Olav Morken <olav....@uninett.no>:

Filip Lyncker

unread,
Jun 10, 2010, 11:02:21 AM6/10/10
to simple...@googlegroups.com
Dear Olav and Thomas,
I have the same problem right now. I want to include the simplesaml in
my magento module, but the autoloader does not work in that inviroment.
Do you have a solution for my problem ? I think in frameworks like
joomla you'll have the same problem ...


thanks & cheers


Filip

--
_________________________________
Filip Lyncker, Dipl.-Inform. (FH)


Lyncker & Theis GmbH
Wilhelmstr. 16
65185 Wiesbaden
Germany

Fon +49 611/9006951
Fax +49 611/9406125


Handelsregister: HRB 23156 Amtsgericht Wiesbaden
Steuernummer: 4023897051
USt-IdNr.: DE255806399

Gesch�ftsf�hrer:
Filip Lyncker,
Armin Theis

Filip Lyncker

unread,
Jun 10, 2010, 11:35:22 AM6/10/10
to simple...@googlegroups.com
Dear List,

Im having trouble decrypting my saml response. I Configured my SP and
want to test it now. Everything works fine but after redirecting to my
SP Page, the testenviroment gives the following error:

maybe I have to insert my keyfile in a seperate configuration file for
decrypting?

thanks a lot for help...

Failure decrypting Data

0: C:\xampp\htdocs\simplesamlphp\lib\xmlseclibs.php:391
(XMLSecurityKey::decryptOpenSSL)
1: C:\xampp\htdocs\simplesamlphp\lib\xmlseclibs.php:427
(XMLSecurityKey::decryptData)
2: C:\xampp\htdocs\simplesamlphp\lib\xmlseclibs.php:1320
(XMLSecEnc::decryptNode)
3: C:\xampp\htdocs\simplesamlphp\lib\xmlseclibs.php:1386
(XMLSecEnc::decryptKey)
4: C:\xampp\htdocs\simplesamlphp\lib\SAML2\Utils.php:345
(SAML2_Utils::decryptElement)
5: C:\xampp\htdocs\simplesamlphp\lib\SAML2\EncryptedAssertion.php:86
(SAML2_EncryptedAssertion::getAssertion)
6: C:\xampp\htdocs\simplesamlphp\modules\saml2\lib\Message.php:339
(sspmod_saml2_Message::decryptAssertion)
7: C:\xampp\htdocs\simplesamlphp\modules\saml2\lib\Message.php:703
(sspmod_saml2_Message::processResponse)
8: C:\xampp\htdocs\simplesamlphp\modules\saml\www\sp\saml2-acs.php:50
(require)
9: C:\xampp\htdocs\simplesamlphp\www\module.php:135 (N/A)

Peter Schober

unread,
Jun 10, 2010, 11:52:30 AM6/10/10
to simple...@googlegroups.com
* Filip Lyncker <lyn...@lyth.de> [2010-06-10 17:44]:

> Im having trouble decrypting my saml response. I Configured my SP and
> want to test it now. Everything works fine but after redirecting to my
> SP Page, the testenviroment gives the following error:
>
> maybe I have to insert my keyfile in a seperate configuration file for
> decrypting?

Have you been following
http://simplesamlphp.org/docs/1.6/simplesamlphp-sp#section_1_1 ?
-peter

Filip Lyncker

unread,
Jun 10, 2010, 12:24:53 PM6/10/10
to simple...@googlegroups.com
Yes Peter ! But my configuration is a little bit different, please have
a look:

1. in the metadata/shib13-idp-remote.php:
(the content of the "certData" field is the same like in my npaCert.pem
file ...)


$metadata['The Identity Manager'] = array(
'name' => array(
'de' => 'Test eID-Server',
),
'description' => 'Testen der ePA Integration ',
'SingleSignOnService'
=>'https://the.eid-server:443/eID-redirect/async',
'certData' =>
'MIIDjzCCAnegAwIBAgIGASjfZJGnMA0GCSqGSIb3DQEBBQUAMGAxEzARBgNVBAMM
Cm5wYXdlYnNob3AxHTAbBgNVBAoMFEJvbmsgQ29uc3VsdGluZyBHbWJIMR0wGwYD
VQQLDBRCb25rIENvbnN1bHRpbmcgR21iSDELMAkGA1UEBhMCZGUwHhcNMTAwNTI4
MTQ1MDI5WhcNMTMwNTI4MTQ1MDI5WjBgMRMwEQYDVQQDDApucGF3ZWJzaG9wMR0w
GwYDVQQKDBRCb25rIENvbnN1bHRpbmcgR21iSDEdMBsGA1UECwwUQm9uayBDb25z
dWx0aW5nIEdtYkgxCzAJBgNVBAYTAmRlMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAk04dfBV8VI+rHdgdfgdgdgTG6SDlAlYQEyoFbCP1h+MVsnCp6HXf
3JaWlyAPFKMmsvD8VRHQJmrlGm4+ZSK7p7vueDqRb5HMMiUAyho/qQDza3SVVqzO
uG/cw5CIW/pDxZN0GzDJXWKdBhMfbcHdl1uYJMMIfSWmxAeDVYWDLrLU9Jm0apT8
yCEQOPjV3TMmlaQvMNh6JzyDJ2QKi5s9QRL4Y2ZBun8Jl89++ufXzOu3dst8ZUpr
MQ48kH6KMyIBHu6smLc6Ju6/7BriV3My4S1Hh8wDoYDSTl5c+/kScOP4pYwWZBOm
QiDtx5deeeXDQ/sJHcidEiI3Izyc0vUbUwIDAQABo08wTTAdBgNVHQ4EFgQUTpKC
j5Fkutcx+WBecBciePNzji4wHwYDVR0jBBgwFoAUTpKCj5Fkutcx+WBecBciePNz
ji4wCwYDVR0PBAQDAgXgMA0GCSqGSIb3DQEBBQUAdfgdfgdfgA4IBAQBGlnRZzK2
Xi6W8CyTNgq1I+4/wcERrFpW6IfbIWkudtWQrAeASediXNOkQBWrj4AwGuMiGBqJ
UACeeL0VtZaELN/uVc7hIEmp+s9trjg6xs1lIFj8UyczDbLeRvtCY/+IhvAN8h4z
WtOO3cYkiunYz7/K2HR0RD6c3zryHpmRElg1CdHQayccvpN94RNcbERpz4HX1LYY
lMejFeeScionxHsoYusDml8pjuY5HBnWW6xB29QZWHXx5RyMObzosuPT1BKsdB4z
HPItqXwZuPgrSIrs619tfSDcr1BGonW7n6vZgbsEp6czrqgaBNriajOnxWcY/Hym
W710',
certFingerprint => '',
'redirect.sign' => TRUE,
SingleLogoutService
=>'https://the.eid-server:8443/eID-redirect/async',
);

2. in the Saml20-idp-remote I didnt configure anything, but pasting the
same entry there doesnt change anything...

3. in the authsources I have :

$config = array(

// This is a authentication source which handles admin authentication.
'admin' => array(
// The default is to use core:AdminPassword, but it can be replaced with
// any authentication source.
'core:AdminPassword',
),
// An authentication source which can authenticate against both SAML 2.0
// and Shibboleth 1.3 IdPs.
'default-sp' => array(
'saml:SP',
'privatekey' => 'mykeyfile2.pem',
'certificate' => 'npaCert.pem',
// The entity ID of this SP.
// Can be NULL/unset, in which case an entity ID is generated based on
the metadata URL.
//my_cons
'entityID' => 'my_cons',

// The entity ID of the IdP this should SP should contact.
// Can be NULL/unset, in which case the user will be shown a list of
available IdPs.
'idp' => 'My Identity Manager',

// The URL to the discovery service.
// Can be NULL/unset, in which case a builtin discovery service will
be used.
'discoURL' => NULL,
),


maybe you have an idea?


thanks a lot for help ...

cheers


Filip

--

Peter Schober

unread,
Jun 10, 2010, 4:31:37 PM6/10/10
to simple...@googlegroups.com
* Filip Lyncker <lyn...@lyth.de> [2010-06-10 18:38]:

> Yes Peter ! But my configuration is a little bit different, please have
> a look:
>
> 1. in the metadata/shib13-idp-remote.php:

You wrote "Im having trouble decrypting my saml response." but XMLenc
is only available as of SAML V2.0, and Shibboleth 1.3 is SAML1.x only.
So there seems to be some confusion.

If you're recieving encrypted assertions, the sending IdP

* needs to be a SAML V2.0 IdP, not Shibboleth 1.3. So this should
match your configuration for that IdP (i.e., don't use
shib13-idp-remote.php).

* needs to have a copy of your SP's public key (from SAML V2 metadata
or via some other means, OOB). So what key did you give to the IdP?
This public key (and matching private key) need also to be
configured on your SP.

> (the content of the "certData" field is the same like in my npaCert.pem
> file ...)

Well, the IdP's certData should be the IdP's public key.
It's highly unlikely to also be your SP's public key.

Also note that entityIds are mandated to be URIs (URNs, URLs), hence
'The Identity Manager' and 'my_cons' are not valid entityIds (but this
has nothing to do with the problem at hand.)
-peter

Olav Morken

unread,
Jun 11, 2010, 1:51:20 AM6/11/10
to simple...@googlegroups.com
On Thu, Jun 10, 2010 at 17:02:21 +0200, Filip Lyncker wrote:
> Dear Olav and Thomas,
> I have the same problem right now. I want to include the simplesaml in
> my magento module, but the autoloader does not work in that inviroment.
> Do you have a solution for my problem ? I think in frameworks like
> joomla you'll have the same problem ...

If the framework doesn't cooperate with the spl_autoload_register()-
function[1], you will have to find out how you can hook an extra
class autoloader into the framework. You need to get the framework to
call the SimpleSAML_autoload()-function from lib/_autoload.php.

On the other hand, if the framework uses the spl_autoload_register()-
function, all you should need to do is to include the lib/_autoload.php
before instantiating any SSP-classes.

[1] http://php.net/manual/en/function.spl-autoload-register.php

Thomas Leidinger

unread,
Jun 11, 2010, 3:32:32 AM6/11/10
to simple...@googlegroups.com
Hi,

might not be the easiest and best solution, but that's how I do it now:

- link to a page outside the framework, which does the authentication
- add security
- write the output to a Session
- redirect to the page inside the framework
- analyze the session data

Hope that helps
Thomas


2010/6/10 Filip Lyncker <lyn...@lyth.de>:

> Geschäftsführer:
> Filip Lyncker,
> Armin Theis
>
> --
> You received this message because you are subscribed to the Google Groups "simpleSAMLphp" group.
> To post to this group, send email to simple...@googlegroups.com.
> To unsubscribe from this group, send email to simplesamlph...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simplesamlphp?hl=en.
>
>

Stefano Gargiulo

unread,
Jun 11, 2010, 3:41:15 AM6/11/10
to simple...@googlegroups.com, Filip Lyncker
This is my solution for Joomla: it is due to the using of old php __autoload function by these frameworks

 

 
<?php if(JPluginHelper::isEnabled('authentication', 'idemauth')) {

        require_once('libraries'.DS.'loader.php'); //Joomla autoloader

        try {
            if(function_exists('__autoload')) {
                $oldautoload =__autoload;
                if (!spl_autoload_register($oldautoload)) { //i switch the function to the new php5 autoloader register that supports multiple autoloaders
                    $PHPverOk=false;
                }else {
                    $PHPverOk=true;
                }
            }else {
                $PHPverOk=true; // Joomla used the autoload_register (now is impossible, but i hope in 1.6 it will be)

            

            }
        }catch(Excetpion $e) {
            $PHPverOk=false;
        }
        if ($PHPverOk) {
//start simplesamlphp
            require_once('components'.DS.'com_idemauth'.DS.'simplesamlphp'.DS.'lib'.DS.'_autoload.php');
            require_once('components'.DS.'com_idemauth'.DS.'config'.DS.'idemauth_config.inc.php');  //ther

Best regards,
Stefano.

Stefano Gargiulo

unread,
Jun 11, 2010, 3:55:40 AM6/11/10
to simple...@googlegroups.com, Filip Lyncker
> > Do you have a solution for my problem ? I think in frameworks like
> > joomla you'll have the same problem ...

This is my solution for Joomla: it is due to the using of old php

__autoload function by these frameworks

<?php if(JPluginHelper::isEnabled('authentication', 'idemauth')) {
require_once('libraries'.DS.'loader.php'); //Joomla autoloader
try {
if(function_exists('__autoload')) {
$oldautoload =__autoload;
if (!spl_autoload_register($oldautoload)) { //i switch
the function to the new php5 autoloader register that supports multiple
autoloaders

$PHPverOk=false; //your php version is too old to
support multiple autoloaders


}else {
$PHPverOk=true;
}
}else {
$PHPverOk=true; // Joomla used the autoload_register

(now is impossible :( , but i hope in 1.6 it will be used)


}
}catch(Excetpion $e) {
$PHPverOk=false;
}
if ($PHPverOk) {

//start simplesamlphp

require_once('components'.DS.'com_idemauth'.DS.'simplesamlphp'.DS.'lib'.DS.'_autoload.php');

require_once('components'.DS.'com_idemauth'.DS.'config'.DS.'idemauth_config.inc.php');
//ther


Best regards,
Stefano.


Il 10/06/2010 17:02, Filip Lyncker ha scritto:

Reply all
Reply to author
Forward
0 new messages