62 : string
63 {
65
66 if (!array_key_exists($attributeKey, $this->userData)) {
68 "Configured external attribute of mapping '%s' -> '%s' does not exist in SAML attribute data.",
69 $this->rule->getAttribute(),
70 $this->rule->getExternalAttribute()
71 ));
72 }
73
74 $value = $this->userData[$attributeKey];
75
76 if (is_array($value)) {
78
79 if (!array_key_exists($valueIndex, $value)) {
81 "Configured external attribute of mapping '%s' -> '%s' does not exist in SAML attribute data.",
82 $this->rule->getAttribute(),
83 $this->rule->getExternalAttribute()
84 ));
85 }
86
87 $value = $value[$valueIndex];
88 }
89
90 if (!is_scalar($value)) {
92 "Could not parse a scalar value based on the user attribute mapping '%s' -> '%s'.",
93 $this->rule->getAttribute(),
94 $this->rule->getExternalAttribute()
95 ));
96 }
97
98 return (string) $value;
99 }