diff --git a/composer.json b/composer.json index 0123f1d..131c9ad 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "extension", "eauth", "openid", "oauth", "authentication"], "homepage": "https://github.com/Nodge/yii2-eauth", "type": "yii2-extension", - "license": "New BSD License", + "license": "MIT", "authors": [ { "name": "Maxim Zemskov", @@ -21,13 +21,13 @@ } }, "require": { - "php": ">=5.4.0", + "php": ">=7.2", "lib-curl": "*", - "yiisoft/yii2": "*", + "yiisoft/yii2": "~2.0.0", "lusitanian/oauth": "~0.3.0", "nodge/lightopenid": "~1.1.0" }, "extra": { "bootstrap": "nodge\\eauth\\Bootstrap" } -} \ No newline at end of file +} diff --git a/src/EAuth.php b/src/EAuth.php index 79bb8be..1fe08e2 100644 --- a/src/EAuth.php +++ b/src/EAuth.php @@ -10,7 +10,7 @@ namespace nodge\eauth; use Yii; -use yii\base\Object; +use yii\base\BaseObject; use yii\helpers\ArrayHelper; use yii\helpers\Url; @@ -19,7 +19,7 @@ * * @package application.extensions.eauth */ -class EAuth extends Object +class EAuth extends BaseObject { /** diff --git a/src/ServiceBase.php b/src/ServiceBase.php index 45b9b38..87e2a8b 100644 --- a/src/ServiceBase.php +++ b/src/ServiceBase.php @@ -10,7 +10,7 @@ namespace nodge\eauth; use Yii; -use yii\base\Object; +use yii\base\BaseObject; use yii\helpers\Url; use yii\helpers\ArrayHelper; use OAuth\Common\Http\Uri\Uri; @@ -21,7 +21,7 @@ * * @package application.extensions.eauth */ -abstract class ServiceBase extends Object implements IAuthService +abstract class ServiceBase extends BaseObject implements IAuthService { /** diff --git a/src/oauth2/Service.php b/src/oauth2/Service.php index cb56dc4..d009d0f 100644 --- a/src/oauth2/Service.php +++ b/src/oauth2/Service.php @@ -182,7 +182,7 @@ protected function getCallbackUrl() array_unshift($route, ''); // Can not use these params in OAuth2 callbacks - foreach (['code', 'state', 'redirect_uri'] as $param) { + foreach (['code', 'state', 'redirect_uri', 'scope'] as $param) { if (isset($route[$param])) { unset($route[$param]); } diff --git a/src/services/FacebookOAuth2Service.php b/src/services/FacebookOAuth2Service.php index f130f07..f2f476a 100644 --- a/src/services/FacebookOAuth2Service.php +++ b/src/services/FacebookOAuth2Service.php @@ -49,15 +49,13 @@ protected function fetchAttributes() 'query' => [ 'fields' => join(',', [ 'id', - 'name', - 'link' + 'name' ]) ] ]); $this->attributes['id'] = $info['id']; $this->attributes['name'] = $info['name']; - $this->attributes['url'] = $info['link']; return true; }