Class yii\authclient\clients\Twitter
| Inheritance | yii\authclient\clients\Twitter » yii\authclient\OAuth1 » yii\authclient\BaseOAuth » yii\authclient\BaseClient » yii\base\Component » yii\base\Object |
|---|---|
| Implements | yii\authclient\ClientInterface, yii\base\Configurable |
| Available since version | 2.0 |
| Source Code | https://github.com/yiisoft/yii2-authclient/blob/master/clients/Twitter.php |
Twitter allows authentication via Twitter OAuth.
In order to use Twitter OAuth you must register your application at https://dev.twitter.com/apps/new.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'twitter' => [
'class' => 'yii\authclient\clients\Twitter',
'consumerKey' => 'twitter_consumer_key',
'consumerSecret' => 'twitter_consumer_secret',
],
],
]
...
]
See also:
Public Properties
Public Methods
Protected Methods
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| CONTENT_TYPE_AUTO | 'auto' | yii\authclient\BaseOAuth | |
| CONTENT_TYPE_JSON | 'json' | yii\authclient\BaseOAuth | |
| CONTENT_TYPE_URLENCODED | 'urlencoded' | yii\authclient\BaseOAuth | |
| CONTENT_TYPE_XML | 'xml' | yii\authclient\BaseOAuth |
Property Details
Method Details
Generates service name.
| string defaultName( ) | ||
| return | string | Service name. |
|---|---|---|
Generates service title.
| string defaultTitle( ) | ||
| return | string | Service title. |
|---|---|---|
Initializes authenticated user attributes.
| array initUserAttributes( ) | ||
| return | array | Auth user attributes. |
|---|---|---|