From baba267635c92ca052ff434b433b7a0f118e6f72 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Dec 2018 10:14:10 +0100 Subject: [pam.php] Helper for bwIDM PAM login Returns list of IdPs as key value pairs: org-suffix=ECP-Endpoint --- pam.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 pam.php (limited to 'pam.php') diff --git a/pam.php b/pam.php new file mode 100644 index 0000000..c5cb8fb --- /dev/null +++ b/pam.php @@ -0,0 +1,22 @@ +.inc.php +function slxAutoloader($class) +{ + $file = 'inc/' . preg_replace('/[^a-z0-9]/', '', mb_strtolower($class)) . '.inc.php'; + if (!file_exists($file)) + return; + require_once $file; +} +spl_autoload_register('slxAutoloader'); + +require_once 'config.php'; + +Header('Content-Type: text/plain; charset=utf-8'); + +$res = Database::simpleQuery("SELECT suffix, authmethod FROM organization INNER JOIN organization_suffix USING(organizationid)"); +while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + if (substr($row['authmethod'], 0, 5) === 'https') { + echo $row['suffix'], '=', $row['authmethod'], "\n"; + } +} -- cgit v1.2.3-55-g7522