ninegate/src/ninegate-1.0/src/Cadoles/CoreBundle/Service/samlAttributeMapperService.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;
}
}