Yii2 API authentication Behaviors() Not working -
i creating restful api in yii2. here facing issue. in usercontroller.php have created behaviour() authentication.
use yii\filters\auth\httpbasicauth; public function behaviors() { $behaviors = parent::behaviors(); $behaviors['authenticator'] = [ 'class' => httpbasicauth::classname(), 'except' => ['signup'] ]; return $behaviors; }
here have passed 'except' => ['signup']
, authentication should not applied 'signup' action.
but here not applied , asking authentication 'signup' action too.
so, please guide have mistaken.
public function behaviors() { $behaviors = parent::behaviors(); $behaviors['authenticator'] = [ [ 'class' => httpbasicauth::classname(), 'except' => ['signup'] ] ]; return $behaviors; }
Comments
Post a Comment