From 8a3fe891497d26cb97f767a01d12fea942f35979 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 6 Apr 2014 00:53:42 -0400 Subject: [PATCH] renamed "auth" to "authenticator". [skip ci] --- docs/guide/rest.md | 8 ++++---- framework/rest/Controller.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide/rest.md b/docs/guide/rest.md index e01b0888ef..9b2baec0ca 100644 --- a/docs/guide/rest.md +++ b/docs/guide/rest.md @@ -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(), ], ]); diff --git a/framework/rest/Controller.php b/framework/rest/Controller.php index b014543f2f..a8999af685 100644 --- a/framework/rest/Controller.php +++ b/framework/rest/Controller.php @@ -74,7 +74,7 @@ class Controller extends \yii\web\Controller 'class' => VerbFilter::className(), 'actions' => $this->verbs(), ], - 'auth' => [ + 'authenticator' => [ 'class' => CompositeAuth::className(), ], 'rateLimiter' => [