}
/**
- * Populate user details from OidcIdToken data.
+ * Populate user details from the given claim data.
*/
public function populate(
ProvidesClaims $claims,
): void {
$this->externalId = $claims->getClaim($idClaim) ?? $this->externalId;
$this->email = $claims->getClaim('email') ?? $this->email;
- $this->name = static::getUserDisplayName($displayNameClaims, $claims, $this->externalId) ?? $this->name;
+ $this->name = static::getUserDisplayName($displayNameClaims, $claims) ?? $this->name;
$this->groups = static::getUserGroups($groupsClaim, $claims) ?? $this->groups;
}
- protected static function getUserDisplayName(string $displayNameClaims, ProvidesClaims $token, string $defaultValue): string
+ protected static function getUserDisplayName(string $displayNameClaims, ProvidesClaims $token): string
{
$displayNameClaimParts = explode('|', $displayNameClaims);
}
}
- if (count($displayName) === 0) {
- $displayName[] = $defaultValue;
- }
-
return implode(' ', $displayName);
}