for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SWP\Bundle\CoreBundle\Security\Provider;
use League\OAuth2\Client\Provider\GenericResourceOwner;
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
class ExternalOauthResourceOwner extends GenericResourceOwner
{
use ArrayAccessorTrait;
protected $response;
/**
* {@inheritdoc}
*/
public function __construct(array $response = [])
$this->response = $response;
}
public function getId(): string
return $this->getValueByKey($this->response, 'sub');
public function getEmail(): string
// Normalize email address
return \strtolower($this->getValueByKey($this->response, 'email'));
public function getName(): string
return $this->getValueByKey($this->response, 'name');
public function toArray(): array
return $this->response;