Skip to content

Commit e86d325

Browse files
committed
add patches result
1 parent c23a070 commit e86d325

File tree

6 files changed

+40
-98
lines changed

6 files changed

+40
-98
lines changed

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,12 @@
12071207
"dev-master": "2.4.0.x-dev"
12081208
},
12091209
"patches_applied": {
1210-
"Multiple older changes re-done, check patch file for details": "patches/0001-WR-333356-Manually-apply-below-patch-due-to-dir-chan.patch"
1210+
"Multiple older changes re-done, check patch file for details": "patches/0001-WR-333356-Manually-apply-below-patch-due-to-dir-chan.patch",
1211+
"Issue #768: Remove unnecessary param being sent to sendSAML2AuthnRequest()": "patches/0002-Issue-768-Remove-unnecessary-param-being-sent-to-sen.patch",
1212+
"Issue #768: Force de-prioritisation of BINDING_HTTP_ARTIFACT": "patches/0003-Issue-768-Force-de-prioritisation-of-BINDING_HTTP_AR.patch",
1213+
"Update post.twig to point to publicly available post files (#793)": "patches/0004-Update-post.twig-to-point-to-publicly-available-post.patch",
1214+
"[#801] fix issue with IdP initiated login after upgrade to v2.0.5 (#802)": "patches/0005-801-fix-issue-with-IdP-initiated-login-after-upgrade.patch",
1215+
"set SESSION->saml2idp during unsolicited logins": "patches/0006-set-SESSION-saml2idp-during-unsolicited-logins.patch"
12111216
}
12121217
},
12131218
"installation-source": "dist",

vendor/simplesamlphp/simplesamlphp/PATCHES.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,23 @@ Multiple older changes re-done, check patch file for details
55
Source: patches/0001-WR-333356-Manually-apply-below-patch-due-to-dir-chan.patch
66

77

8+
Issue #768: Remove unnecessary param being sent to sendSAML2AuthnRequest()
9+
Source: patches/0002-Issue-768-Remove-unnecessary-param-being-sent-to-sen.patch
10+
11+
12+
Issue #768: Force de-prioritisation of BINDING_HTTP_ARTIFACT
13+
Source: patches/0003-Issue-768-Force-de-prioritisation-of-BINDING_HTTP_AR.patch
14+
15+
16+
Update post.twig to point to publicly available post files (#793)
17+
Source: patches/0004-Update-post.twig-to-point-to-publicly-available-post.patch
18+
19+
20+
[#801] fix issue with IdP initiated login after upgrade to v2.0.5 (#802)
21+
Source: patches/0005-801-fix-issue-with-IdP-initiated-login-after-upgrade.patch
22+
23+
24+
set SESSION->saml2idp during unsolicited logins
25+
Source: patches/0006-set-SESSION-saml2idp-during-unsolicited-logins.patch
26+
27+

vendor/simplesamlphp/simplesamlphp/modules/saml/src/Auth/Source/SP.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -316,24 +316,9 @@ public function getHostedMetadata(): array
316316
public function getIdPMetadata(string $entityId): Configuration
317317
{
318318
// auth_saml2 modification.
319-
global $saml2auth;
320-
if ($this->idp !== null && $this->idp !== $entityId) {
321-
foreach ($saml2auth->metadataentities as $metadataurl => $idpentities) {
322-
if ($metadataurl == $entityId) {
323-
foreach ($idpentities as $key => $val) {
324-
if ($key == $this->idp) {
325-
$this->idp = null;
326-
}
327-
break 2;
328-
329-
}
330-
}
331-
}
332-
}
333-
if ($this->idp !== null && $this->idp !== $entityId) {
334-
throw new Error\Exception('Cannot retrieve metadata for IdP ' .
335-
var_export($entityId, true) . ' because it isn\'t a valid IdP for this SP.');
336-
}
319+
// Set the IdP to null, so it can auto-detect.
320+
// Avoid the case where it uses the default IdP data for IdP initiated login.
321+
$this->idp = null;
337322

338323
$metadataHandler = MetaDataStorageHandler::getMetadataHandler();
339324

@@ -676,6 +661,8 @@ private function startSSO2(Configuration $idpMetadata, array $state): void
676661
[
677662
Constants::BINDING_HTTP_REDIRECT,
678663
Constants::BINDING_HTTP_POST,
664+
// auth_saml2 modification - Reordered to maintain existing functionality.
665+
Constants::BINDING_HTTP_ARTIFACT,
679666
],
680667
);
681668
}
@@ -689,7 +676,7 @@ private function startSSO2(Configuration $idpMetadata, array $state): void
689676
$session = \SimpleSAML\Session::getSessionFromRequest();
690677
$session->save();
691678

692-
$this->sendSAML2AuthnRequest($state, $b, $ar);
679+
$this->sendSAML2AuthnRequest($b, $ar);
693680

694681
Assert::true(false);
695682
}
@@ -1236,6 +1223,11 @@ public static function handleUnsolicitedAuth(string $authId, array $state, strin
12361223
// Moodle hack to handle IdP unsolicited logins.
12371224
$wantsurl = (new \moodle_url($redirectTo))->out(false);
12381225
$SESSION->wantsurl = $wantsurl;
1226+
if (!empty($state['saml:sp:IdP'])) {
1227+
$SESSION->saml2idp = md5($state['saml:sp:IdP']);
1228+
} else {
1229+
unset($SESSION->saml2idp);
1230+
}
12391231
$saml2auth->saml_login_complete($state['Attributes']);
12401232
// Should never get to here.
12411233

vendor/simplesamlphp/simplesamlphp/templates/post.php

Lines changed: 0 additions & 75 deletions
This file was deleted.

vendor/simplesamlphp/simplesamlphp/templates/post.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
77
<link rel="icon" href="{{ asset("icons/favicon.ico") }}">
88
<title>{% trans %}Sending message{% endtrans %}</title>
9-
<link rel="stylesheet" href="{{ asset("css/postSubmit.css") }}">
10-
<script src="{{ asset("js/post.js") }}"></script>
9+
<link rel="stylesheet" href="/{{ baseurlpath }}resources/post.css">
10+
<script src="/{{ baseurlpath }}resources/post.js"></script>
1111
</head>
1212
<body>
1313
<form method="post" action="{{ destination }}">

0 commit comments

Comments
 (0)