These filter classes are all under the `yii\filters\auth` namespace.
The following example shows how you can use [[yii\filters\auth\HttpBasicAuth]] to authenticate a user using
an access token based on HTTP Basic Auth method. Note that in order for this to work, your
[[yii\web\User::identityClass|user identity class]] must implement the [[yii\web\IdentityInterface::findIdentityByAccessToken()|findIdentityByAccessToken()]]
method.
```php
useyii\filters\auth\HttpBasicAuth;
publicfunctionbehaviors()
{
return[
'basicAuth'=>[
'class'=>HttpBasicAuth::className(),
],
];
}
```
Authentication method filters are commonly used in implementing RESTful APIs. For more details, please refer to the