Abstract Class yii\authclient\BaseClient
BaseClient is a base Auth Client class.
See also yii\authclient\ClientInterface.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$behaviors | yii\base\Behavior[] | List of behaviors attached to this component. This property is read-only. | yii\base\Component |
$httpClient | yii\httpclient\Client | Internal HTTP client. Note that the type of this property differs in getter and setter. See getHttpClient() and setHttpClient() for details. | yii\authclient\BaseClient |
$id | string | Service id. | yii\authclient\BaseClient |
$name | string | Service name. | yii\authclient\BaseClient |
$normalizeUserAttributeMap | array | Normalize user attribute map. | yii\authclient\BaseClient |
$requestOptions | array | HTTP request options. This property is read-only. | yii\authclient\BaseClient |
$stateStorage | yii\authclient\StateStorageInterface | Stage storage. Note that the type of this property differs in getter and setter. See getStateStorage() and setStateStorage() for details. | yii\authclient\BaseClient |
$title | string | Service title. | yii\authclient\BaseClient |
$userAttributes | array | List of user attributes. | yii\authclient\BaseClient |
$viewOptions | array | View options in format: optionName => optionValue. | yii\authclient\BaseClient |
Public Methods
Protected Methods
Property Details
Internal HTTP client. Note that the type of this property differs in getter and setter. See getHttpClient() and setHttpClient() for details.
Service id.
Service name.
Normalize user attribute map.
HTTP request options. This property is read-only.
Stage storage. Note that the type of this property differs in getter and setter. See getStateStorage() and setStateStorage() for details.
Service title.
List of user attributes.
View options in format: optionName => optionValue.
Method Details
Creates HTTP client instance from reference or configuration.
protected yii\httpclient\Client createHttpClient ( $reference ) | ||
$reference | string|array | Component name or array configuration. |
return | yii\httpclient\Client | HTTP client instance. |
---|
Creates HTTP request instance.
public yii\httpclient\Request createRequest ( ) | ||
return | yii\httpclient\Request | HTTP request instance. |
---|
Generates service name.
protected string defaultName ( ) | ||
return | string | Service name. |
---|
Returns the default $normalizeUserAttributeMap value.
Particular client may override this method in order to provide specific default map.
protected array defaultNormalizeUserAttributeMap ( ) | ||
return | array | Normalize attribute map. |
---|
Returns default HTTP request options.
protected array defaultRequestOptions ( ) | ||
return | array | HTTP request options. |
---|
Generates service title.
protected string defaultTitle ( ) | ||
return | string | Service title. |
---|
Returns the default $viewOptions value.
Particular client may override this method in order to provide specific default view options.
protected array defaultViewOptions ( ) | ||
return | array | List of default $viewOptions |
---|
Returns HTTP client.
public yii\httpclient\Client getHttpClient ( ) | ||
return | yii\httpclient\Client | Internal HTTP client. |
---|
public string getId ( ) | ||
return | string | Service id |
---|
public string getName ( ) | ||
return | string | Service name. |
---|
public array getNormalizeUserAttributeMap ( ) | ||
return | array | Normalize user attribute map. |
---|
public array getRequestOptions ( ) | ||
return | array | HTTP request options. |
---|
Returns persistent state value.
protected mixed getState ( $key ) | ||
$key | string | State key. |
return | mixed | State value. |
---|
Returns session key prefix, which is used to store internal states.
protected string getStateKeyPrefix ( ) | ||
return | string | Session key prefix. |
---|
public yii\authclient\StateStorageInterface getStateStorage ( ) | ||
return | yii\authclient\StateStorageInterface | Stage storage. |
---|
public string getTitle ( ) | ||
return | string | Service title. |
---|
public array getUserAttributes ( ) | ||
return | array | List of user attributes |
---|
public array getViewOptions ( ) | ||
return | array | View options in format: optionName => optionValue |
---|
Initializes authenticated user attributes.
protected abstract array initUserAttributes ( ) | ||
return | array | Auth user attributes. |
---|
Normalize given user attributes according to $normalizeUserAttributeMap.
protected array normalizeUserAttributes ( $attributes ) | ||
$attributes | array | Raw attributes. |
return | array | Normalized attributes. |
---|---|---|
throws | yii\base\InvalidConfigException | on incorrect normalize attribute map. |
Removes persistent state value.
protected boolean removeState ( $key ) | ||
$key | string | State key. |
return | boolean | Success. |
---|
Sets HTTP client to be used.
public void setHttpClient ( $httpClient ) | ||
$httpClient | array|yii\httpclient\Client | Internal HTTP client. |
public void setId ( $id ) | ||
$id | string | Service id. |
public void setName ( $name ) | ||
$name | string | Service name. |
public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap ) | ||
$normalizeUserAttributeMap | array | Normalize user attribute map. |
public void setRequestOptions ( array $options ) | ||
$options | array | HTTP request options. |
Sets persistent state.
protected $this setState ( $key, $value ) | ||
$key | string | State key. |
$value | mixed | State value |
return | $this | The object itself |
---|
public void setStateStorage ( $stateStorage ) | ||
$stateStorage | yii\authclient\StateStorageInterface|array|string | Stage storage to be used. |
public void setTitle ( $title ) | ||
$title | string | Service title. |
public void setUserAttributes ( $userAttributes ) | ||
$userAttributes | array | List of user attributes |
public void setViewOptions ( $viewOptions ) | ||
$viewOptions | array | View options in format: optionName => optionValue |