Permalink
Browse files

Working around 'SubjectConfirmation was not found' issue due to inval…

…id URL parsing, documented here: onelogin/php-saml#175 (comment)
  • Loading branch information...
patricknelson committed Aug 18, 2017
1 parent e3ddc42 commit 3532565a8050268192aa36f9b644e45c68b624b0
Showing with 6 additions and 1 deletion.
  1. +6 −1 code/control/SAMLController.php
@@ -35,6 +35,10 @@ public function acs()
{
/** @var OneLogin_Saml2_Auth $auth */
$auth = Injector::inst()->get('SAMLHelper')->getSAMLAuth();
// Required to workaround a *possible* bug/regression caused by php-saml package: https://github.com/onelogin/php-saml/pull/175#issuecomment-323235699
$auth->getSettings()->setBaseURL('');
$auth->processResponse();
$error = $auth->getLastErrorReason();
@@ -51,6 +55,7 @@ public function acs()
return $this->getRedirect();
}
$decodedNameId = base64_decode($auth->getNameId());
// check that the NameID is a binary string (which signals that it is a guid
if (ctype_print($decodedNameId)) {
@@ -97,7 +102,7 @@ public function acs()
$member->$field = $attributes[$claim][0];
}
$member->SAMLSessionIndex = $auth->getSessionIndex();
// This will trigger LDAP update through LDAPMemberExtension::memberLoggedIn.

0 comments on commit 3532565

Please sign in to comment.