Abstract Class yii\authclient\BaseClient
BaseClient is a base Auth Client class.
See also yii\authclient\ClientInterface.
Public Methods
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| createHttpClient() | Creates HTTP client instance from reference or configuration. | yii\authclient\BaseClient |
| defaultName() | Generates service name. | yii\authclient\BaseClient |
| defaultNormalizeUserAttributeMap() | Returns the default \yii\authclient\normalizeUserAttributeMap value. | yii\authclient\BaseClient |
| defaultRequestOptions() | Returns default HTTP request options. | yii\authclient\BaseClient |
| defaultTitle() | Generates service title. | yii\authclient\BaseClient |
| defaultViewOptions() | Returns the default \yii\authclient\viewOptions value. | yii\authclient\BaseClient |
| getState() | Returns persistent state value. | yii\authclient\BaseClient |
| getStateKeyPrefix() | Returns session key prefix, which is used to store internal states. | yii\authclient\BaseClient |
| initUserAttributes() | Initializes authenticated user attributes. | yii\authclient\BaseClient |
| normalizeUserAttributes() | Normalize given user attributes according to \yii\authclient\normalizeUserAttributeMap. | yii\authclient\BaseClient |
| removeState() | Removes persistent state value. | yii\authclient\BaseClient |
| setState() | Sets persistent state. | yii\authclient\BaseClient |
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 \yii\authclient\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 \yii\authclient\viewOptions value.
Particular client may override this method in order to provide specific default view options.
| protected array defaultViewOptions ( ) | ||
| return | array | List of default \yii\authclient\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 \yii\authclient\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 |