Apache Конфигурация Mellon - PullRequest
       25

Apache Конфигурация Mellon

0 голосов
/ 07 февраля 2020

Я пытаюсь настроить сервер apache для аутентификации saml и для этого использую apache mellon.

Я настроил apache и в / var / www/html Я написал простой php сервер с двумя маршрутами: / и /spa/callback/postResponse.

Проблема в том, что после входа в систему провайдера идентификации переадресация не прекращается (похоже, что продолжайте отправлять сообщения на мой маршрут / spa / callback / postResponse).

Я предполагаю, что проблема в конфигурации mellon, но я не знаю, как ее настроить.

Мой 000-default .conf выглядит так:

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

    <Directory "/var/www/html">
         AllowOverride All
    </Directory>

    <Location />
    # Add information from the mod_auth_mellon session to the request.
    MellonEnable "info"

    # Configure the SP metadata
    # This should be the files which were created when creating SP metadata.
    MellonSPPrivateKeyFile /var/www/saml_sp.key

    MellonSPCertFile /var/www/saml_sp.cert
    MellonSPMetadataFile /var/www/saml_sp.xml

    # IdP metadata. This should be the metadata file you got from the IdP.
    MellonIdPMetadataFile /var/www/metadata.xml

        MellonSamlResponseDump On
    MellonIDP "IDP"
        MellonSetEnv "username" "username"

    # The location all endpoints should be located under.
    # It is the URL to this location that is used as the second parameter to the metadata generation script.
    # This path is relative to the root of the web server.
    MellonEndpointPath /mellon
</Location>

# This is a location that will trigger authentication when requested.
<Location /auth_mellon.php>
    # This location will trigger an authentication request to the IdP.
    MellonEnable "auth"
</Location>

        <Location />
    #This location will trigger an authentication request to the IdP.
    MellonEnable "auth"
    </Location>


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

</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

В / var / www/html у меня есть несколько php файлов, а индекс. php выглядит так:

<?php

include_once 'Request.php';
include_once 'Router.php';
$router = new Router(new Request);

$router->get('/', function() {
  return <<<HTML
  <h1>Hello world</h1>
HTML;
});

$router->post('/spa/callback/postResponse', function() {
    exit();
    return;
});


$router->get('/profile', function($request) {
  return <<<HTML
  <h1>Profile</h1>
HTML;
});

$router->post('/data', function($request) {

  return json_encode($request->getBody());
});
...