19 lines
483 B
PHP
19 lines
483 B
PHP
<?php
|
|
|
|
namespace Cadoles\CoreBundle\Service;
|
|
|
|
use LightSaml\Model\Protocol\Response;
|
|
|
|
class samlAttributeMapperService
|
|
{
|
|
public function getAttributesFromResponse(Response $response): array
|
|
{
|
|
$attributes = [];
|
|
|
|
foreach ($response->getFirstAssertion()->getFirstAttributeStatement()->getAllAttributes() as $attribute) {
|
|
$attributes[$attribute->getFriendlyName()] = $attribute->getFirstAttributeValue();
|
|
}
|
|
return $attributes;
|
|
}
|
|
}
|