Commit 8a3fe891 by Qiang Xue

renamed "auth" to "authenticator". [skip ci]

parent 83da0cd0
......@@ -603,17 +603,17 @@ Yii supports all of the above authentication methods. You can also easily create
To enable authentication for your APIs, do the following two steps:
1. Specify which authentication methods you plan to use by configuring the `auth` behavior
1. Specify which authentication methods you plan to use by configuring the `authenticator` behavior
in your REST controller classes.
2. Implement [[yii\web\IdentityInterface::findIdentityByAccessToken()]] in your [[yii\web\User::identityClass|user identity class]].
For example, to enable all three authentication methods explained above, you can configure `auth` like following,
For example, to enable all three authentication methods explained above, you can configure `authenticator` like following,
```php
public function behaviors()
{
return array_merge(parent::behaviors(), [
'auth' => [
'authenticator' => [
'authMethods' => [
\yii\filters\auth\HttpBasicAuth::className(),
\yii\filters\auth\QueryParamAuth::className(),
......@@ -633,7 +633,7 @@ If you only want to a single authentication method, such as HTTP Basic Auth, you
public function behaviors()
{
return array_merge(parent::behaviors(), [
'auth' => [
'authenticator' => [
'class' => \yii\filters\auth\HttpBasicAuth::className(),
],
]);
......
......@@ -74,7 +74,7 @@ class Controller extends \yii\web\Controller
'class' => VerbFilter::className(),
'actions' => $this->verbs(),
],
'auth' => [
'authenticator' => [
'class' => CompositeAuth::className(),
],
'rateLimiter' => [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment