Add endpoints to .gitignore

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-11-24 10:12:07 +01:00
parent a616f1d238
commit c56bb495d3
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1
4 changed files with 1 additions and 97 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
3rdparty/vendor/onelogin/php-saml/demo-old/
3rdparty/vendor/onelogin/php-saml/docs/
3rdparty/vendor/onelogin/php-saml/tests/
3rdparty/vendor/onelogin/php-saml/endpoints/

View file

@ -1,51 +0,0 @@
<?php
/**
* SP Assertion Consumer Service Endpoint
*/
session_start();
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
$auth = new OneLogin_Saml2_Auth();
$auth->processResponse();
$errors = $auth->getErrors();
if (!empty($errors)) {
print_r('<p>'.implode(', ', $errors).'</p>');
exit();
}
if (!$auth->isAuthenticated()) {
echo "<p>Not authenticated</p>";
exit();
}
$_SESSION['samlUserdata'] = $auth->getAttributes();
$_SESSION['IdPSessionIndex'] = $auth->getSessionIndex();
if (isset($_POST['RelayState']) && OneLogin_Saml2_Utils::getSelfURL() != $_POST['RelayState']) {
$auth->redirectTo($_POST['RelayState']);
}
$attributes = $_SESSION['samlUserdata'];
if (!empty($attributes)) {
echo '<h1>'._('User attributes:').'</h1>';
echo '<table><thead><th>'._('Name').'</th><th>'._('Values').'</th></thead><tbody>';
foreach ($attributes as $attributeName => $attributeValues) {
echo '<tr><td>'.htmlentities($attributeName).'</td><td><ul>';
foreach ($attributeValues as $attributeValue) {
echo '<li>'.htmlentities($attributeValue).'</li>';
}
echo '</ul></td></tr>';
}
echo '</tbody></table>';
if (!empty($_SESSION['IdPSessionIndex'])) {
echo '<p>The SessionIndex of the IdP is: '.$_SESSION['IdPSessionIndex'].'</p>';
}
} else {
echo _('Attributes not found');
}

View file

@ -1,25 +0,0 @@
<?php
/**
* SP Metadata Endpoint
*/
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
try {
$auth = new OneLogin_Saml2_Auth();
$settings = $auth->getSettings();
$metadata = $settings->getSPMetadata();
$errors = $settings->validateMetadata($metadata);
if (empty($errors)) {
header('Content-Type: text/xml');
echo $metadata;
} else {
throw new OneLogin_Saml2_Error(
'Invalid SP metadata: '.implode(', ', $errors),
OneLogin_Saml2_Error::METADATA_SP_INVALID
);
}
} catch (Exception $e) {
echo $e->getMessage();
}

View file

@ -1,21 +0,0 @@
<?php
/**
* SP Single Logout Service Endpoint
*/
session_start();
require_once dirname(dirname(__FILE__)).'/_toolkit_loader.php';
$auth = new OneLogin_Saml2_Auth();
$auth->processSLO();
$errors = $auth->getErrors();
if (empty($errors)) {
print_r('Sucessfully logged out');
} else {
print_r(implode(', ', $errors));
}