0 フォロワー

インターフェース yii\filters\auth\AuthInterface

実装者yii\filters\auth\AuthMethodyii\filters\auth\CompositeAuthyii\filters\auth\HttpBasicAuthyii\filters\auth\HttpBearerAuthyii\filters\auth\HttpHeaderAuthyii\filters\auth\QueryParamAuth
利用可能なバージョン2.0
ソースコード https://github.com/yiisoft/yii2/blob/master/framework/filters/auth/AuthInterface.php

AuthInterfaceは、認証メソッドクラスが実装すべきインターフェースです。

パブリックメソッド

継承されたメソッドを隠す

メソッド 説明 定義元
authenticate() 現在のユーザーを認証します。 yii\filters\auth\AuthInterface
challenge() 認証失敗時にチャレンジを生成します。 yii\filters\auth\AuthInterface
handleFailure() 認証失敗を処理します。 yii\filters\auth\AuthInterface

メソッドの詳細

継承されたメソッドを隠す

authenticate() public abstract method

現在のユーザーを認証します。

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

認証されたユーザーの識別情報。認証情報が提供されない場合は、nullが返されます。

throws yii\web\UnauthorizedHttpException

認証情報が提供されたが無効な場合。

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

            
challenge() public abstract method

認証失敗時にチャレンジを生成します。

例えば、適切なHTTPヘッダーが生成される場合があります。

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

                public function challenge($response);

            
handleFailure() public abstract method

認証失敗を処理します。

実装では通常、認証失敗を示すためにUnauthorizedHttpExceptionをスローする必要があります。

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

                public function handleFailure($response);