Skip to content

Commit 090dc73

Browse files
authored
Merge pull request #1 from csingletwd/drupalauth#90Support-simplesamlphp-2.x
drupalauth#90: Support simplesamlphp 2.x
2 parents 71cb642 + a44257e commit 090dc73

File tree

6 files changed

+34
-13
lines changed

6 files changed

+34
-13
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,24 @@ Configure the authentication source by putting following code into `simplesamlph
131131
),
132132
),
133133
```
134+
in composer.json add these repos:
135+
{
136+
"name": "drupal/drupalauth4ssp",
137+
"type": "git",
138+
"url": "https://git.drupalcode.org/issue/drupalauth4ssp-3287081.git"
139+
},
140+
{
141+
"name": "drupalauth/simplesamlphp-module-drupalauth",
142+
"type": "git",
143+
"url": "https://github.com/csingletwd/simplesamlphp-module-drupalauth.git"
144+
},
145+
146+
147+
and require section looks like this:
148+
149+
"drupal/drupalauth4ssp": "dev-3287081-automated-drupal-10",
150+
"drupal/memcache": "^2.5",
151+
"drupal/simplesamlphp_auth": "4.x-dev@dev",
152+
"drupalauth/simplesamlphp-module-drupalauth": "1.9.x-dev",
153+
"drush/drush": "^12.x-dev",
154+
"simplesamlphp/simplesamlphp": "dev-simplesamlphp-2.1"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^5.6.0|^7.0|^8.0",
25-
"simplesamlphp/simplesamlphp": "~1.0",
24+
"php": "^5.6.0|^7.0|^8.0|^8.1",
25+
"simplesamlphp/simplesamlphp": "dev-simplesamlphp-2.1",
2626
"simplesamlphp/composer-module-installer": "~1.0"
2727
},
2828
"require-dev": {
@@ -34,7 +34,7 @@
3434
},
3535
"extra": {
3636
"branch-alias": {
37-
"dev-master": "1.8.x-dev"
37+
"dev-master": "1.9.x-dev"
3838
}
3939
}
4040
}

lib/Auth/Source/External.php renamed to src/Auth/Source/External.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
use SimpleSAML\Module\drupalauth\ConfigHelper;
1414
use SimpleSAML\Module\drupalauth\DrupalHelper;
1515
use SimpleSAML\Utils\HTTP;
16+
use Symfony\Component\HttpFoundation\Request;
17+
use Symfony\Component\HttpFoundation\Response;
1618

1719
/**
1820
* Drupal authentication source for SimpleSAMLphp using Drupal's login page.
@@ -169,7 +171,7 @@ private function getUser()
169171
*
170172
* @param array &$state Information about the current authentication.
171173
*/
172-
public function authenticate(&$state)
174+
public function authenticate(array &$state): void
173175
{
174176
assert(is_array($state));
175177

@@ -235,14 +237,10 @@ public function authenticate(&$state)
235237
* Note the 'ReturnTo' parameter. This must most likely be replaced with
236238
* the real name of the parameter for the login page.
237239
*/
238-
HTTP::redirectTrustedURL($authPage, [
240+
$http_utils = new HTTP();
241+
$http_utils->redirectTrustedURL($authPage, [
239242
'ReturnTo' => $returnTo,
240243
]);
241-
242-
/*
243-
* The redirect function never returns, so we never get this far.
244-
*/
245-
assert(false);
246244
}
247245

248246
/**
@@ -327,7 +325,7 @@ public static function resume()
327325
*
328326
* @param array &$state The logout state array.
329327
*/
330-
public function logout(&$state)
328+
public function logout(array &$state): void
331329
{
332330
assert(is_array($state));
333331

@@ -347,6 +345,7 @@ public function logout(&$state)
347345
$parameters['ReturnTo'] = $state['ReturnTo'];
348346
}
349347

350-
HTTP::redirectTrustedURL($logout_url, $parameters);
348+
$http_utils = new HTTP();
349+
$http_utils->redirectTrustedURL($logout_url, $parameters);
351350
}
352351
}
File renamed without changes.

lib/ConfigHelper.php renamed to src/ConfigHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public function __construct($config, $location)
9393
$this->drupal_login_url = $config->getString('drupal_login_url', null);
9494

9595
$this->cookie_path = Configuration::getInstance()->getBasePath();
96-
$this->cookie_salt = Config::getSecretSalt();
96+
$config_utils = new Config();
97+
$this->cookie_salt = $config_utils->getSecretSalt();
9798
}
9899

99100

File renamed without changes.

0 commit comments

Comments
 (0)