From faaeb602071f5bc6ff3d8a5a53ea9504865559b8 Mon Sep 17 00:00:00 2001 From: Ishan Jayamanne Date: Mon, 4 Apr 2022 21:40:46 +1200 Subject: [PATCH] generate valid Guid to match the validation. --- src/Control/SAMLController.php | 3 +-- src/Helpers/SAMLHelper.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Control/SAMLController.php b/src/Control/SAMLController.php index cc280ee..0ccbcc9 100644 --- a/src/Control/SAMLController.php +++ b/src/Control/SAMLController.php @@ -153,8 +153,6 @@ public function acs() return $this->getRedirect(); } - $this->extend('updateGuid', $guid); - $attributes = $auth->getAttributes(); // Allows setups that map GUID (email format) to email {@see SAMLConfiguration::$expose_guid_as_attribute}. @@ -163,6 +161,7 @@ public function acs() } $this->extend('updateAttributes', $attributes); + $this->extend('updateGuid', $guid); $fieldToClaimMap = array_flip(Member::config()->claims_field_mappings); diff --git a/src/Helpers/SAMLHelper.php b/src/Helpers/SAMLHelper.php index 6993825..0249e7b 100644 --- a/src/Helpers/SAMLHelper.php +++ b/src/Helpers/SAMLHelper.php @@ -124,7 +124,7 @@ public function binToStrGuid($object_guid) $hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2); } $hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4); - $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20); + $hex_guid_to_guid_str .= '-' . substr($hex_guid, 20, 12); return strtoupper($hex_guid_to_guid_str); }