0 follower

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\HttpHeaderAuth, yii\filters\auth\QueryParamAuth
Available since version2.0
Source Codehttps://.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

Hide inherited methods

authenticate() public abstract method

Authenticates the current user.

public abstract yii\web\IdentityInterface|null authenticate ( $user, $request, $response )
$useryii\web\User
$requestyii\web\Request
$responseyii\web\Response
returnyii\web\IdentityInterface|null

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

throwsyii\web\UnauthorizedHttpException

if authentication information is provided but is invalid.

                public function authenticate($user, $request, $response);

            
challenge() public abstract method

Generates challenges upon authentication failure.

For example, some appropriate HTTP headers may be generated.

public abstract void challenge ( $response )
$responseyii\web\Response

                public function challenge($response);

            
handleFailure() public abstract method

Handles authentication failure.

The implementation should normally throw UnauthorizedHttpException to indicate authentication failure.

public abstract void handleFailure ( $response )
$responseyii\web\Response
throwsyii\web\UnauthorizedHttpException

                public function handleFailure($response);