Skip to content

Commit

Permalink
Prepare for SSP 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Feb 16, 2020
1 parent cf9f9d0 commit ca688a4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -14,10 +14,10 @@
}
],
"require": {
"simplesamlphp/composer-module-installer": "~1.0"
"simplesamlphp/composer-module-installer": "~1.0",
"simplesamlphp/simplesamlphp": "dev-master"
},
"require-dev": {
"simplesamlphp/simplesamlphp": "~1.17",
"simplesamlphp/simplesamlphp-test-framework": "~0.1.0"
}
}
Expand Down
3 changes: 0 additions & 3 deletions default-enable

This file was deleted.

12 changes: 8 additions & 4 deletions www/attributes.php
@@ -1,15 +1,19 @@
<?php

use Exception;
use SimpleSAML\Auth;
use SimpleSAML\Error;

try {
if (!isset($_GET['SourceID'])) {
throw new \SimpleSAML\Error\BadRequest('Missing SourceID parameter');
throw new Error\BadRequest('Missing SourceID parameter');
}
$sourceId = $_GET['SourceID'];

$as = new \SimpleSAML\Auth\Simple($sourceId);
$as = new Auth\Simple($sourceId);

if (!$as->isAuthenticated()) {
throw new \SimpleSAML\Error\Exception('Not authenticated.');
throw new Error\Exception('Not authenticated.');
}

$attributes = $as->getAttributes();
Expand All @@ -22,7 +26,7 @@
echo "\t$value\n";
}
}
} catch (\Exception $e) {
} catch (Exception $e) {
header('HTTP/1.0 500 Internal Server Error');
header('Content-Type: text/plain; charset=utf-8');
echo "ERROR\n";
Expand Down
10 changes: 7 additions & 3 deletions www/login.php
@@ -1,18 +1,22 @@
<?php

use Exception;
use SimpleSAML\Auth;
use SimpleSAML\Error;

try {
if (!isset($_GET['SourceID'])) {
throw new \SimpleSAML\Error\BadRequest('Missing SourceID parameter');
throw new Error\BadRequest('Missing SourceID parameter');
}
$sourceId = $_GET['SourceID'];

$as = new \SimpleSAML\Auth\Simple($sourceId);
$as = new Auth\Simple($sourceId);

$as->requireAuth();

header('Content-Type: text/plain; charset=utf-8');
echo "OK\n";
} catch (\Exception $e) {
} catch (Exception $e) {
header('HTTP/1.0 500 Internal Server Error');
header('Content-Type: text/plain; charset=utf-8');
echo "ERROR\n";
Expand Down
10 changes: 7 additions & 3 deletions www/logout.php
@@ -1,19 +1,23 @@
<?php

use Exception;
use SimpleSAML\Auth;
use SimpleSAML\Error;

try {
if (!isset($_GET['SourceID'])) {
throw new \SimpleSAML\Error\BadRequest('Missing SourceID parameter');
throw new Error\BadRequest('Missing SourceID parameter');
}
$sourceId = $_GET['SourceID'];

$as = new \SimpleSAML\Auth\Simple($sourceId);
$as = new Auth\Simple($sourceId);

if ($as->isAuthenticated()) {
$as->logout();
}
header('Content-Type: text/plain; charset=utf-8');
echo "OK\n";
} catch (\Exception $e) {
} catch (Exception $e) {
header('HTTP/1.0 500 Internal Server Error');
header('Content-Type: text/plain; charset=utf-8');
echo "ERROR\n";
Expand Down

0 comments on commit ca688a4

Please sign in to comment.