Yii2 Restapi HttpBasicAuth problem

Hello I m using yii2.0 rc

I’m trying to add HttpBasicAuth to my restapi using this tutorial http://www.yiiframework.com/doc-2.0/guide-rest-authentication.html

I’m adding this block of code

use yii\filters\auth\HttpBasicAuth;

public function behaviors()


    $behaviors = parent::behaviors();

    $behaviors['authenticator'] = [

        'class' => HttpBasicAuth::className(),


    return $behaviors;


and implementig the IdentityInterface

use yii\web\IdentityInterface;

class MyClass extends ActiveRecord implements IdentityInterface


    public static function findIdentityByAccessToken($token, $type = null)


        return static::findOne(['access_token' => $token]);



But I cant define BasicAuth params. I dont know how can I or where can I define basicauth variables

Please help me

Thank you so much

please help