Fixed logout

This commit is contained in:
Peder Bergebakken Sundt 2017-10-22 17:32:54 +02:00
parent d047a99fd3
commit 731663e4c0
2 changed files with 9 additions and 4 deletions

3
dev.sh
View File

@ -7,7 +7,8 @@ if test \! -d vendor; then
composer install composer install
cp -v dist/authsources_example.php vendor/simplesamlphp/simplesamlphp/config/authsources.php cp -v dist/authsources_example.php vendor/simplesamlphp/simplesamlphp/config/authsources.php
cp -v dist/saml20-idp-remote.php vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php cp -v dist/saml20-idp-remote.php vendor/simplesamlphp/simplesamlphp/metadata/saml20-idp-remote.php
cp -v vendor/simplesamlphp/simplesamlphp/config-templates/config.php vendor/simplesamlphp/simplesamlphp/config/config.php # cp -v vendor/simplesamlphp/simplesamlphp/config-templates/config.php vendor/simplesamlphp/simplesamlphp/config/config.php
sed -e "s/'trusted.url.domains' => array()/'trusted.url.domains' => array('localhost:1080')/g" < vendor/simplesamlphp/simplesamlphp/config-templates/config.php > vendor/simplesamlphp/simplesamlphp/config/config.php
ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml ln -s ../vendor/simplesamlphp/simplesamlphp/www/ www/simplesaml
fi fi

View File

@ -2,9 +2,13 @@
require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php'); require_once(__DIR__ . '/../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp'); $as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth(); $as->requireAuth();
$attributes = $as->getAttributes(); $attributes = $as->getAttributes();
print_r($attributes);
?> ?>
test <p>
Username: <?= $attributes["uid"][0]?><br>
Full name: <?= $attributes["cn"][0]?><br>
Email: <?= $attributes["mail"][0]?><br>
</p>
<a href="<?= htmlspecialchars($as->getLogoutURL("http://localhost:1080/")) ?>">logout</a>