没有命名空间的类 yii yii\base yii\behaviors yii\caching yii\captcha yii\console yii\console\controllers yii\console\widgets yii\data yii\db yii\db\conditions yii\db\cubrid yii\db\cubrid\conditions yii\db\mssql yii\db\mssql\conditions yii\db\mysql yii\db\oci yii\db\oci\conditions yii\db\pgsql yii\db\sqlite yii\db\sqlite\conditions yii\di yii\filters yii\filters\auth yii\grid yii\helpers yii\i18n yii\log yii\mail yii\mutex yii\rbac yii\rest yii\test yii\validators yii\web yii\widgets

Interface yii\filters\auth\AuthInterface

实现yii\filters\auth\AuthMethod, yii\filters\auth\CompositeAuth, yii\filters\auth\HttpBasicAuth, yii\filters\auth\HttpBearerAuth, yii\filters\auth\HttpHeaderAuth, yii\filters\auth\QueryParamAuth
可用版本自2.0
源码 https://github.com/yiichina/yii2/blob/api/framework/filters/auth/AuthInterface.php

AuthInterface is the interface that should be implemented by auth method classes.

公共方法

隐藏继承的方法

方法描述被定义在
authenticate() Authenticates the current user. yii\filters\auth\AuthInterface
challenge() Generates challenges upon authentication failure. yii\filters\auth\AuthInterface
handleFailure() Handles authentication failure. yii\filters\auth\AuthInterface

方法详情

authenticate() 公共 抽象 方法

Authenticates the current user.

public abstract yii\web\IdentityInterface authenticate($user, $request, $response)
$user yii\web\User
$request yii\web\Request
$response yii\web\Response
return yii\web\IdentityInterface

The authenticated user identity. If authentication information is not provided, null will be returned.

throws yii\web\UnauthorizedHttpException

if authentication information is provided but is invalid.

challenge() 公共 抽象 方法

Generates challenges upon authentication failure.

For example, some appropriate HTTP headers may be generated.

public abstract void challenge($response)
$response yii\web\Response
handleFailure() 公共 抽象 方法

Handles authentication failure.

The implementation should normally throw UnauthorizedHttpException to indicate authentication failure.

public abstract void handleFailure($response)
$response yii\web\Response
throws yii\web\UnauthorizedHttpException