Skip to content

Commit fff8ab9

Browse files
committed
Allow logins without first name attribute
Service accounts do not have a first name in our idm, so they can not connect.
1 parent 1068569 commit fff8ab9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app/Auth/ExternalUser.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,16 @@ public function validate()
108108

109109
foreach ($requiredAttributes as $attribute) {
110110
if ($this->getFirstAttributeValue($attribute) == null) {
111-
Log::error('Required attribute missing', ['attribute' => $attribute, 'attributes' => $this->getAttributes()]);
112-
113-
throw new MissingAttributeException($attribute);
111+
if ($attribute === 'first_name') {
112+
// Set "first_name" to a single space if it's missing
113+
$this->setAttribute('first_name', '');
114+
} else {
115+
Log::error('Required attribute missing', [
116+
'attribute' => $attribute,
117+
'attributes' => $this->getAttributes()
118+
]);
119+
throw new MissingAttributeException($attribute);
120+
}
114121
}
115122
}
116123
}

0 commit comments

Comments
 (0)