user->enableSession = false; } public function behaviors() { $behaviors = parent::behaviors(); $module = $this->id; $controller = $this->module->controller->id; $action = $this->module->controller->action->id; $noCheckActions = \Yii::$app->params['noCheckTokenActions']; if(!in_array($module.'/'.$controller.'/'.$action, $noCheckActions)){ $behaviors['authenticator'] = [ 'class' => 'yii\filters\auth\CompositeAuth', 'authMethods' => [ 'yii\filters\auth\HttpBasicAuth', 'yii\filters\auth\HttpBearerAuth', 'yii\filters\auth\QueryParamAuth', ], ]; } return $behaviors; } }