@@ -34,6 +34,14 @@ class OneLogin_Saml2_Auth
3434 */
3535 private $ _nameidFormat ;
3636
37+
38+ /**
39+ * NameID NameQualifier
40+ *
41+ * @var string
42+ */
43+ private $ _nameidNameQualifier ;
44+
3745 /**
3846 * If user is authenticated.
3947 *
@@ -177,6 +185,7 @@ public function processResponse($requestId = null)
177185 $ this ->_attributes = $ response ->getAttributes ();
178186 $ this ->_nameid = $ response ->getNameId ();
179187 $ this ->_nameidFormat = $ response ->getNameIdFormat ();
188+ $ this ->_nameidNameQualifier = $ response ->getNameIdNameQualifier ();
180189 $ this ->_authenticated = true ;
181190 $ this ->_sessionIndex = $ response ->getSessionIndex ();
182191 $ this ->_sessionExpiration = $ response ->getSessionNotOnOrAfter ();
@@ -336,6 +345,16 @@ public function getNameIdFormat()
336345 return $ this ->_nameidFormat ;
337346 }
338347
348+ /**
349+ * Returns the nameID NameQualifier
350+ *
351+ * @return string The nameID NameQualifier of the assertion
352+ */
353+ public function getNameIdNameQualifier ()
354+ {
355+ return $ this ->_nameidNameQualifier ;
356+ }
357+
339358 /**
340359 * Returns the SessionIndex
341360 *
@@ -436,18 +455,19 @@ public function login($returnTo = null, $parameters = array(), $forceAuthn = fal
436455 /**
437456 * Initiates the SLO process.
438457 *
439- * @param string|null $returnTo The target URL the user should be returned to after logout.
440- * @param array $parameters Extra parameters to be added to the GET
441- * @param string|null $nameId The NameID that will be set in the LogoutRequest.
442- * @param string|null $sessionIndex The SessionIndex (taken from the SAML Response in the SSO process).
443- * @param bool $stay True if we want to stay (returns the url string) False to redirect
444- * @param string|null $nameIdFormat The NameID Format will be set in the LogoutRequest.
458+ * @param string|null $returnTo The target URL the user should be returned to after logout.
459+ * @param array $parameters Extra parameters to be added to the GET
460+ * @param string|null $nameId The NameID that will be set in the LogoutRequest.
461+ * @param string|null $sessionIndex The SessionIndex (taken from the SAML Response in the SSO process).
462+ * @param bool $stay True if we want to stay (returns the url string) False to redirect
463+ * @param string|null $nameIdFormat The NameID Format will be set in the LogoutRequest.
464+ * @param string|null $nameIdNameQualifier The NameID NameQualifier will be set in the LogoutRequest.
445465 *
446466 * @return If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters
447467 *
448468 * @throws OneLogin_Saml2_Error
449469 */
450- public function logout ($ returnTo = null , $ parameters = array (), $ nameId = null , $ sessionIndex = null , $ stay = false , $ nameIdFormat = null )
470+ public function logout ($ returnTo = null , $ parameters = array (), $ nameId = null , $ sessionIndex = null , $ stay = false , $ nameIdFormat = null , $ nameIdNameQualifier = null )
451471 {
452472 assert ('is_array($parameters) ' );
453473
@@ -466,7 +486,7 @@ public function logout($returnTo = null, $parameters = array(), $nameId = null,
466486 $ nameIdFormat = $ this ->_nameidFormat ;
467487 }
468488
469- $ logoutRequest = new OneLogin_Saml2_LogoutRequest ($ this ->_settings , null , $ nameId , $ sessionIndex , $ nameIdFormat );
489+ $ logoutRequest = new OneLogin_Saml2_LogoutRequest ($ this ->_settings , null , $ nameId , $ sessionIndex , $ nameIdFormat, $ nameIdNameQualifier );
470490
471491 $ this ->_lastRequest = $ logoutRequest ->getXML ();
472492 $ this ->_lastRequestID = $ logoutRequest ->id ;
0 commit comments