On this page
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 | yii\base\Component |
$httpClient | yii\httpclient\Client | Internal HTTP client. | 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. | yii\authclient\BaseClient |
$stateStorage | yii\authclient\StateStorageInterface | Stage storage. | 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
$httpClient public property
Internal HTTP client.
public yii\httpclient\Client getHttpClient ( )
public void setHttpClient ( $httpClient )
$id public property
Service id.
public string getId ( )
public void setId ( $id )
$name public property
Service name.
public string getName ( )
public void setName ( $name )
$normalizeUserAttributeMap public property
Normalize user attribute map.
public array getNormalizeUserAttributeMap ( )
public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap )
$requestOptions public property
HTTP request options.
public array getRequestOptions ( )
public void setRequestOptions ( array $options )
$stateStorage public property
Stage storage.
public yii\authclient\StateStorageInterface getStateStorage ( )
public void setStateStorage ( $stateStorage )
$title public property
Service title.
public string getTitle ( )
public void setTitle ( $title )
$userAttributes public property
List of user attributes
public array getUserAttributes ( )
public void setUserAttributes ( $userAttributes )
$viewOptions public property
View options in format: optionName => optionValue
public array getViewOptions ( )
public void setViewOptions ( $viewOptions )
Method Details
createHttpClient() protected method (available since version 2.1)
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. |
createRequest() public method (available since version 2.1)
Creates HTTP request instance.
public yii\httpclient\Request createRequest ( ) | ||
---|---|---|
return | yii\httpclient\Request | HTTP request instance. |
defaultName() protected method
Generates service name.
protected string defaultName ( ) | ||
---|---|---|
return | string | Service name. |
defaultNormalizeUserAttributeMap() protected method
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. |
defaultRequestOptions() protected method (available since version 2.1)
Returns default HTTP request options.
protected array defaultRequestOptions ( ) | ||
---|---|---|
return | array | HTTP request options. |
defaultTitle() protected method
Generates service title.
protected string defaultTitle ( ) | ||
---|---|---|
return | string | Service title. |
defaultViewOptions() protected method
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 |
getHttpClient() public method (available since version 2.1)
Returns HTTP client.
public yii\httpclient\Client getHttpClient ( ) | ||
---|---|---|
return | yii\httpclient\Client | Internal HTTP client. |
getId() public method
getName() public method
getNormalizeUserAttributeMap() public method
public array getNormalizeUserAttributeMap ( ) | ||
---|---|---|
return | array | Normalize user attribute map. |
getRequestOptions() public method (available since version 2.1)
public array getRequestOptions ( ) | ||
---|---|---|
return | array | HTTP request options. |
getState() protected method
Returns persistent state value.
getStateKeyPrefix() protected method
Returns session key prefix, which is used to store internal states.
protected string getStateKeyPrefix ( ) | ||
---|---|---|
return | string | Session key prefix. |
getStateStorage() public method
public yii\authclient\StateStorageInterface getStateStorage ( ) | ||
---|---|---|
return | yii\authclient\StateStorageInterface | Stage storage. |
getTitle() public method
getUserAttributes() public method
public array getUserAttributes ( ) | ||
---|---|---|
return | array | List of user attributes |
getViewOptions() public method
public array getViewOptions ( ) | ||
---|---|---|
return | array | View options in format: optionName => optionValue |
initUserAttributes() protected abstract method
Initializes authenticated user attributes.
protected abstract array initUserAttributes ( ) | ||
---|---|---|
return | array | Auth user attributes. |
normalizeUserAttributes() protected method
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. |
removeState() protected method
Removes persistent state value.
protected boolean removeState ( $key ) | ||
---|---|---|
$key | string | State key. |
return | boolean | Success. |
setHttpClient() public method (available since version 2.1)
Sets HTTP client to be used.
public void setHttpClient ( $httpClient ) | ||
---|---|---|
$httpClient | array|yii\httpclient\Client | Internal HTTP client. |
setId() public method
setName() public method
setNormalizeUserAttributeMap() public method
public void setNormalizeUserAttributeMap ( $normalizeUserAttributeMap ) | ||
---|---|---|
$normalizeUserAttributeMap | array | Normalize user attribute map. |
setRequestOptions() public method (available since version 2.1)
public void setRequestOptions ( array $options ) | ||
---|---|---|
$options | array | HTTP request options. |
setState() protected method
Sets persistent state.
protected $this setState ( $key, $value ) | ||
---|---|---|
$key | string | State key. |
$value | mixed | State value |
return | $this | The object itself |
setStateStorage() public method
public void setStateStorage ( $stateStorage ) | ||
---|---|---|
$stateStorage | yii\authclient\StateStorageInterface|array|string | Stage storage to be used. |
setTitle() public method
setUserAttributes() public method
public void setUserAttributes ( $userAttributes ) | ||
---|---|---|
$userAttributes | array | List of user attributes |
setViewOptions() public method
public void setViewOptions ( $viewOptions ) | ||
---|---|---|
$viewOptions | array | View options in format: optionName => optionValue |
© 2008–2017 by Yii Software LLC
Licensed under the three clause BSD license.
http://www.yiiframework.com/doc-2.0/yii-authclient-baseclient.html