From 6a6c13a8d0f82cef21c2bb81727be0db53b6d431 Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Mon, 3 Dec 2018 17:58:23 +0100 Subject: [PATCH] Fix negotiate for old ui --- modules/negotiate/lib/Auth/Source/Negotiate.php | 5 +---- modules/negotiate/templates/redirect.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 modules/negotiate/templates/redirect.php diff --git a/modules/negotiate/lib/Auth/Source/Negotiate.php b/modules/negotiate/lib/Auth/Source/Negotiate.php index 21601452f..bba08d6bb 100644 --- a/modules/negotiate/lib/Auth/Source/Negotiate.php +++ b/modules/negotiate/lib/Auth/Source/Negotiate.php @@ -49,7 +49,6 @@ class Negotiate extends \SimpleSAML\Auth\Source if (!extension_loaded('krb5')) { throw new \Exception('KRB5 Extension not installed'); } - // call the parent constructor first, as required by the interface parent::__construct($info, $config); @@ -242,15 +241,13 @@ class Negotiate extends \SimpleSAML\Auth\Source $config = \SimpleSAML\Configuration::getInstance(); $url = htmlspecialchars(\SimpleSAML\Module::getModuleURL('negotiate/backend.php', $params)); - $json_url = json_encode($url); header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: Negotiate', false); - $t = new \SimpleSAML\XHTML\Template($config, 'negotiate:redirect.twig'); + $t = new \SimpleSAML\XHTML\Template($config, 'negotiate:redirect.php'); $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('negotiate'); $t->data['url'] = $url; - $t->data['json_url'] = $json_url; $t->show(); } diff --git a/modules/negotiate/templates/redirect.php b/modules/negotiate/templates/redirect.php new file mode 100644 index 000000000..7d7f07c21 --- /dev/null +++ b/modules/negotiate/templates/redirect.php @@ -0,0 +1,11 @@ +<!DOCTYPE HTML> +<html lang="en-US"> + <head> + <script src="<?php echo $this->data['baseurlpath']; ?>/assets/js/redirect.js"></script> + <title>Redirect to login</title> + </head> + <body> + <p>Your browser seems to have Javascript disabled. Please click <a id="redirect" href="<?php echo $this->data['url']; ?>">here</a>.</p> + </body> +</html> + -- GitLab