ApacheMellon配置

ApacheMellon配置,apache,single-sign-on,saml,mellon,Apache,Single Sign On,Saml,Mellon,我正在尝试为saml身份验证配置apache服务器,并使用ApacheMellon实现这一点 我配置了apache,并在/var/www/html中编写了一个简单的php服务器,其中包含两条路由: /和/spa/回调/后响应 问题是,在登录到身份提供程序后,重定向不会停止(它看起来像是继续发布到my/spa/callback/postResponse路由) 我想问题在于梅隆配置,但我不知道如何配置它 My 000-default.conf如下所示: <VirtualHost *:80>

我正在尝试为saml身份验证配置apache服务器,并使用ApacheMellon实现这一点

我配置了apache,并在/var/www/html中编写了一个简单的php服务器,其中包含两条路由: /和/spa/回调/后响应

问题是,在登录到身份提供程序后,重定向不会停止(它看起来像是继续发布到my/spa/callback/postResponse路由)

我想问题在于梅隆配置,但我不知道如何配置它

My 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
<?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());
});

服务器管理员webmaster@localhost
DocumentRoot/var/www/html
允许超越所有
#将mod_auth_mellon会话中的信息添加到请求中。
可编辑的“信息”
#配置SP元数据
#这应该是创建SP元数据时创建的文件。
MellonsPrivateKeyFile/var/www/saml_sp.key
MellonsCertFile/var/www/saml_sp.cert
MellonsMetadatafile/var/www/saml_sp.xml
#IdP元数据。这应该是您从IdP获得的元数据文件。
MellonIdPMetadataFile/var/www/metadata.xml
MellonSamlResponseDump On
MellonIDP“IDP”
MellonSetEnv“用户名”“用户名”
#所有端点应位于的位置。
#此位置的URL用作元数据生成脚本的第二个参数。
#此路径相对于web服务器的根目录。
梅隆点路径/梅隆
#这是一个在请求时将触发身份验证的位置。
#此位置将触发对IdP的身份验证请求。
可编辑的“auth”
#此位置将触发对IdP的身份验证请求。
可编辑的“auth”
ErrorLog${APACHE_LOG_DIR}/error.LOG
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
#vim:syntax=apachets=4sw=4sts=4srnoet
在/var/www/html中,我有一些php文件,index.php如下所示:

<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
<?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());
});