Interface yii\filters\auth\AuthInterface
AuthInterface 是应该由 Auth 方法类实现的接口。
公共方法
| 方法 | 描述 | 被定义在 |
|---|---|---|
| authenticate() | 对当前用户进行身份验证。 | yii\filters\auth\AuthInterface |
| challenge() | 在身份验证失败时产生质询。 例如,一些适当的 HTTP headers 可能会生成。 | yii\filters\auth\AuthInterface |
| handleFailure() | 处理身份验证失败。 该实现通常应抛出未经授权的 UnauthorizedHttpException 异常以指示身份验证失败。 | yii\filters\auth\AuthInterface |
方法详情
对当前用户进行身份验证。
| 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 | 已验证的用户标识。如果不提供身份验证信息,则返回空。 |
|---|---|---|
| throws | yii\web\UnauthorizedHttpException | 如果提供的身份验证信息无效。 |
在身份验证失败时产生质询。 例如,一些适当的 HTTP headers 可能会生成。
| public abstract void challenge($response) | ||
| $response | yii\web\Response | |
处理身份验证失败。 该实现通常应抛出未经授权的 UnauthorizedHttpException 异常以指示身份验证失败。
| public abstract void handleFailure($response) | ||
| $response | yii\web\Response | |
| throws | yii\web\UnauthorizedHttpException | |
|---|---|---|