2

I'm trying to integrate simpleSAMLphp with my application but I am getting this problem:

When I execute the requireAuth method, I get redirected to a 404 page, more specifically "http://test.localhost/simplesaml/module.php/saml/disco.php{lot of params here}"

this, of course, gives me a 404 not found, since my Virtual Host for simplesamlphp is "http://simplesamlphp.localhost"

Which configuration am I missing?

Here is the full code of my application:

<?php
require_once('/var/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth();
$attributes = $as->getAttributes();
print_r($attributes);

And here are my Virtual Hosts configuration, in /etc/apache2/sites-enabled/000-default.conf

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerName simplesamlphp.localhost
    DocumentRoot /var/www/simplesamlphp.localhost

    Alias /simplesaml /var/simplesamlphp/www
</VirtualHost>

<VirtualHost *:80>
    ServerName teste.localhost
    DocumentRoot /var/www/html/teste/
</VirtualHost>
priki
  • 709
  • 1
  • 7
  • 13

1 Answers1

1

Try setting $config[baseurlpath] to http://simplesamlphp.localhost/simplesaml/ in /var/simplesamlphp/config/config.php.

This should allow SimpleSamlPHP to redirect to valid URI so it can give a more useful error message.

Benjamin
  • 1,221
  • 11
  • 28