Skip to content

Commit 9fedfa3

Browse files
committed
set SESSION->saml2idp during unsolicited logins
This makes the IdP known in saml_login_complete() and tenant callback.
1 parent 1d154ed commit 9fedfa3

File tree

1 file changed

+5
-0
lines changed
  • .extlib/simplesamlphp/modules/saml/src/Auth/Source

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,11 @@ public static function handleUnsolicitedAuth(string $authId, array $state, strin
11361136
// Moodle hack to handle IdP unsolicited logins.
11371137
$wantsurl = (new \moodle_url($redirectTo))->out(false);
11381138
$SESSION->wantsurl = $wantsurl;
1139+
if (!empty($state['saml:sp:IdP'])) {
1140+
$SESSION->saml2idp = md5($state['saml:sp:IdP']);
1141+
} else {
1142+
unset($SESSION->saml2idp);
1143+
}
11391144
$saml2auth->saml_login_complete($state['Attributes']);
11401145
// Should never get to here.
11411146

0 commit comments

Comments
 (0)