2016-06-15 184 views
0

私は、PHP WebアプリケーションのSSOを設定しようとしています。私はApacheでmod_auth_mellonを設定して、Idp authページにリダイレクトし、ログインに応答してクッキーを取得しています。mod_auth_mellonでログインしたら、どのようにしてユーザー名を取得できますか?

私のhttpd.confには以下が含まれています。

MellonCacheSize 100 
MellonLockFile "/var/run/mod_auth_mellon.lock" 
MellonPostTTL 900 
MellonPostSize 1048576 
MellonPostCount 100 

<Location /secret> 
    Require valid-user 
    AuthType "Mellon" 
    MellonEnable "auth" 
    MellonVariable "cookie" 
    MellonSecureCookie On 
    MellonCookiePath/
    MellonUser "NAME_ID" 
    MellonMergeEnvVars On 
    MellonMergeEnvVars On ":" 
    MellonEnvVarsIndexStart 1 

    MellonSessionDump Off 
    MellonSamlResponseDump Off 

    MellonEndpointPath "/secret/endpoint" 
    MellonDefaultLoginPath "/" 

    MellonSessionLength 86400 
    MellonNoCookieErrorPage "https://example.com/no_cookie.html" 
    MellonSPMetadataFile /etc/apache2/mellon/sp-metadata.xml 
    MellonSPPrivateKeyFile /etc/apache2/ssl.key 
    MellonSPCertFile /etc/apache2/ssl.crt 
    MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml 

    MellonSamlResponseDump Off 
    MellonSessionDump Off 
    MellonAuthnContextClassRef "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport" 
    MellonECPSendIDPList Off 
    MellonRedirectDomains [self] 
</Location> 

私はindex.phpのを持っているとき、私は結果を取得しています:

<?php 
print_r($_COOKIE["mellon-cookie"]); 
?> 

次のようになります。どうすればよい6ce7d6484360f5a98683e0ae87738635

これを使用してアプリケーションに送信するユーザー名を取得しますか?

編集: 私は次の出力を見てみました:

print_r($_REQUEST); 
print_r($_SESSION); 
print_r($_POST); 
print_r($_GET); 

答えて

0

データは、PHPで$_SERVER変数に格納されています。

次のphpはすべてのキーと値を表示します。

<?php 
header('Content-Type: text/plain'); 

foreach($_SERVER as $key=>$value) { 
    if(substr($key, 0, 7) == 'MELLON_') { 
    echo($key . '=' . $value . "\r\n"); 
    } 
} 
?> 
関連する問題