_provider = $provider; } /** * {@inheritDoc} */ public function getProviderName() { return (new \ReflectionClass($this->_provider))->getShortName(); } /** * {@inheritDoc} */ public function getAuthorizationUrl() { return $this->_provider->getAuthorizationUrl(); } /** * {@inheritDoc} */ public function fetchAccessToken($code) { $this->_accessToken = $this->_provider->getAccessToken('authorization_code', [ 'code' => $code ]); } /** * {@inheritDoc} */ public function getResourceData() { $resource = $this->_provider->getResourceOwner($this->_accessToken); return $resource->toArray(); } }