for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace zacksleo\yii2\oauth2\api\components;
use yii\helpers\ArrayHelper;
use yii\filters\auth\HttpBearerAuth;
use yii\filters\auth\QueryParamAuth;
use filsh\yii2\oauth2server\filters\auth\CompositeAuth;
/**
* Class AuthController
*/
class Oauth2Controller extends RestController
{
* @inheritdoc
public function behaviors()
return ArrayHelper::merge(parent::behaviors(), [
'authenticator' => [
'class' => CompositeAuth::className(),
'authMethods' => [
['class' => HttpBearerAuth::className()],
['class' => QueryParamAuth::className(), 'tokenParam' => 'access_token'],
]
],
]);
}