19 declare(strict_types=1);
34 private readonly array $userData
43 preg_match(self::ATTR_REGEX, $this->rule->getExternalAttribute(), $matches);
45 if (is_array($matches) && isset($matches[3]) && is_numeric($matches[3])) {
46 $index = (
int) $matches[3];
49 return max($index, 0);
57 preg_match(self::ATTR_REGEX, $this->rule->getExternalAttribute(), $matches);
59 if (is_array($matches) && isset($matches[1]) && is_string($matches[1])) {
60 $attribute = $matches[1];
70 if (!array_key_exists($attributeKey, $this->userData)) {
72 "Configured external attribute of mapping '%s' -> '%s' does not exist in SAML attribute data.",
73 $this->rule->getAttribute(),
74 $this->rule->getExternalAttribute()
78 $value = $this->userData[$attributeKey];
80 if (is_array($value)) {
83 if (!array_key_exists($valueIndex, $value)) {
85 "Configured external attribute of mapping '%s' -> '%s' does not exist in SAML attribute data.",
86 $this->rule->getAttribute(),
87 $this->rule->getExternalAttribute()
91 $value = $value[$valueIndex];
94 if (!is_scalar($value)) {
96 "Could not parse a scalar value based on the user attribute mapping '%s' -> '%s'.",
97 $this->rule->getAttribute(),
98 $this->rule->getExternalAttribute()
102 return (
string) $value;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private readonly ilExternalAuthUserAttributeMappingRule $rule, private readonly array $userData)
Class ilSamlMappedUserAttributeValueParser.