Skip to content
Snippets Groups Projects
Commit cad0adc5 authored by Jaime Pérez's avatar Jaime Pérez
Browse files

bugfix: bugfix: Make sure empty strings are not acceptable for NameID generation.

This resolves #519.
parent ecb0c80c
No related branches found
No related tags found
No related merge requests found
...@@ -133,6 +133,13 @@ class sspmod_saml_Auth_Process_SQLPersistentNameID extends sspmod_saml_BaseNameI ...@@ -133,6 +133,13 @@ class sspmod_saml_Auth_Process_SQLPersistentNameID extends sspmod_saml_BaseNameI
$uid = array_values($state['Attributes'][$this->attribute]); // just in case the first index is no longer 0 $uid = array_values($state['Attributes'][$this->attribute]); // just in case the first index is no longer 0
$uid = $uid[0]; $uid = $uid[0];
if (empty($uid)) {
SimpleSAML\Logger::warning(
'Empty value in attribute '.var_export($this->attribute, true).
' on user - not generating persistent NameID.'
);
return null;
}
$value = sspmod_saml_IdP_SQLNameID::get($idpEntityId, $spEntityId, $uid); $value = sspmod_saml_IdP_SQLNameID::get($idpEntityId, $spEntityId, $uid);
if ($value !== null) { if ($value !== null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment