Interface yii\filters\auth\AuthInterface
AuthInterface is the interface that should be implemented by auth method classes.
Public Methods
Method | Description | Defined By |
---|---|---|
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 |
Method Details
Authenticates the current user.
public abstract yii\web\IdentityInterface|null authenticate ( $user, $request, $response ) | ||
$user | yii\web\User | |
$request | yii\web\Request | |
$response | yii\web\Response | |
return | yii\web\IdentityInterface|null |
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. |
public function authenticate($user, $request, $response);
Generates challenges upon authentication failure.
For example, some appropriate HTTP headers may be generated.
public abstract void challenge ( $response ) | ||
$response | yii\web\Response |
public function challenge($response);
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 |
---|
public function handleFailure($response);
Signup or Login in order to comment.