Interface yii\filters\auth\AuthInterface

Implemented byyii\filters\auth\AuthMethod, yii\filters\auth\CompositeAuth, yii\filters\auth\HttpBasicAuth, yii\filters\auth\HttpBearerAuth, yii\filters\auth\QueryParamAuth
Available since version2.0
Source Code https://github.com/yiisoft/yii2/blob/master/framework/filters/auth/AuthInterface.php

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

Public Methods

Hide inherited methods

MethodDescriptionDefined 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

authenticate() public method

Authenticates the current user.

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() public method

Generates challenges upon authentication failure.

For example, some appropriate HTTP headers may be generated.

void challenge$response )
$response yii\web\Response
handleFailure() public method

Handles authentication failure.

The implementation should normally throw UnauthorizedHttpException to indicate authentication failure.

void handleFailure$response )
$response yii\web\Response
throws yii\web\UnauthorizedHttpException