Abstract Class yii\filters\auth\AuthMethod
Inheritance | yii\filters\auth\AuthMethod » yii\base\ActionFilter » yii\base\Behavior » yii\base\Object |
---|---|
Implements | yii\base\Configurable, yii\filters\auth\AuthInterface |
Subclasses | yii\filters\auth\CompositeAuth, yii\filters\auth\HttpBasicAuth, yii\filters\auth\HttpBearerAuth, yii\filters\auth\QueryParamAuth |
Available since version | 2.0 |
Source Code | https://github.com/yiisoft/yii2/blob/master/framework/filters/auth/AuthMethod.php |
AuthMethod is a base class implementing the yii\filters\auth\AuthInterface interface.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$except | array | List of action IDs that this filter should not apply to. | yii\base\ActionFilter |
$only | array | List of action IDs that this filter should apply to. | yii\base\ActionFilter |
$owner | yii\base\Component | The owner of this behavior | yii\base\Behavior |
$request | yii\web\Request | The current request. | yii\filters\auth\AuthMethod |
$response | yii\web\Response | The response to be sent. | yii\filters\auth\AuthMethod |
$user | yii\web\User | The user object representing the user authentication status. | yii\filters\auth\AuthMethod |
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Calls the named method which is not a class method. | yii\base\Object |
__construct() | Constructor. | yii\base\Object |
__get() | Returns the value of an object property. | yii\base\Object |
__isset() | Checks if a property is set, i.e. defined and not null. | yii\base\Object |
__set() | Sets value of an object property. | yii\base\Object |
__unset() | Sets an object property to null. | yii\base\Object |
afterAction() | This method is invoked right after an action is executed. | yii\base\ActionFilter |
afterFilter() | yii\base\ActionFilter | |
attach() | Attaches the behavior object to the component. | yii\base\Behavior |
authenticate() | Authenticates the current user. | yii\filters\auth\AuthInterface |
beforeAction() | This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action. | yii\filters\auth\AuthMethod |
beforeFilter() | yii\base\ActionFilter | |
canGetProperty() | Returns a value indicating whether a property can be read. | yii\base\Object |
canSetProperty() | Returns a value indicating whether a property can be set. | yii\base\Object |
challenge() | Generates challenges upon authentication failure. | yii\filters\auth\AuthMethod |
className() | Returns the fully qualified name of this class. | yii\base\Object |
detach() | Detaches the behavior object from the component. | yii\base\Behavior |
events() | Declares event handlers for the $owner's events. | yii\base\Behavior |
handleFailure() | Handles authentication failure. | yii\filters\auth\AuthMethod |
hasMethod() | Returns a value indicating whether a method is defined. | yii\base\Object |
hasProperty() | Returns a value indicating whether a property is defined. | yii\base\Object |
init() | Initializes the object. | yii\base\Object |
Protected Methods
Method | Description | Defined By |
---|---|---|
isActive() | Returns a value indicating whether the filer is active for the given action. | yii\base\ActionFilter |
Property Details
The current request. If not set, the request
application component will be used.
The response to be sent. If not set, the response
application component will be used.
The user object representing the user authentication status. If not set, the user
application component will be used.
Method Details
This method is invoked right before an action is to be executed (after all possible filters.) You may override this method to do last-minute preparation for the action.
boolean beforeAction( $action ) | ||
$action | yii\base\Action | The action to be executed. |
return | boolean | Whether the action should continue to be executed. |
---|
Generates challenges upon authentication failure.
For example, some appropriate HTTP headers may be generated.
void challenge( $response ) | ||
$response | yii\web\Response |
Handles authentication failure.
The implementation should normally throw UnauthorizedHttpException to indicate authentication failure.
void handleFailure( $response ) | ||
$response | yii\web\Response | |
throws | yii\web\UnauthorizedHttpException |
---|