Class yii\authclient\clients\TwitterOAuth2
| Inheritance | yii\authclient\clients\TwitterOAuth2 » yii\authclient\OAuth2 » yii\authclient\BaseOAuth » yii\authclient\BaseClient » yii\base\Component » yii\base\BaseObject |
|---|---|
| Implements | yii\authclient\ClientInterface, yii\base\Configurable |
| Available since version | 2.1.4 |
| Source Code | https://github.com/yiisoft/yii2-authclient/blob/master/clients/TwitterOAuth2.php |
TwitterOAuth2 allows authentication via Twitter OAuth 2.
Note, that at the time these docs are written, Twitter does not provide full support for OAuth 2 protocol. It is supported only for application-only authentication workflow. Thus only authenticateClient() method of this class has a practical usage.
Any authentication attempt on behalf of the end-user will fail for this client. You should use yii\authclient\clients\Twitter class for this workflow.
See also:
Public Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $apiBaseUrl | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 | |
| $authUrl | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 | |
| $autoRefreshAccessToken | boolean | Whether to automatically perform 'refresh access token' request on expired access token. | yii\authclient\BaseOAuth |
| $clientId | string | OAuth client ID. | yii\authclient\OAuth2 |
| $clientSecret | string | OAuth client secret. | yii\authclient\OAuth2 |
| $parametersToKeepInReturnUrl | array | List of the parameters to keep in default return url. | yii\authclient\BaseOAuth |
| $scope | string | Auth request scope. | yii\authclient\BaseOAuth |
| $tokenUrl | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 | |
| $validateAuthState | boolean | Whether to use and validate auth 'state' parameter in authentication flow. | yii\authclient\OAuth2 |
| $version | string | Protocol version. | yii\authclient\BaseOAuth |
Public Methods
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| applyClientCredentialsToRequest() | Applies client credentials (e.g. $clientId and $clientSecret) to the HTTP request instance. | yii\authclient\OAuth2 |
| composeUrl() | Composes URL from base URL and GET params. | yii\authclient\BaseOAuth |
| createHttpClient() | Creates HTTP client instance from reference or configuration. | yii\authclient\BaseClient |
| createSignatureMethod() | Creates signature method instance from its configuration. | yii\authclient\BaseOAuth |
| createToken() | Creates token from its configuration. | yii\authclient\BaseOAuth |
| defaultName() | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 |
| defaultNormalizeUserAttributeMap() | Returns the default \yii\authclient\normalizeUserAttributeMap value. | yii\authclient\BaseClient |
| defaultRequestOptions() | Returns default HTTP request options. | yii\authclient\BaseClient |
| defaultReturnUrl() | Composes default \yii\authclient\returnUrl value. | yii\authclient\BaseOAuth |
| defaultTitle() | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 |
| defaultViewOptions() | Returns the default \yii\authclient\viewOptions value. | yii\authclient\BaseClient |
| generateAuthState() | Generates the auth state value. | yii\authclient\OAuth2 |
| getState() | Returns persistent state value. | yii\authclient\BaseClient |
| getStateKeyPrefix() | Returns session key prefix, which is used to store internal states. | yii\authclient\BaseClient |
| initUserAttributes() | {@inheritdoc} | yii\authclient\clients\TwitterOAuth2 |
| normalizeUserAttributes() | Normalize given user attributes according to \yii\authclient\normalizeUserAttributeMap. | yii\authclient\BaseClient |
| removeState() | Removes persistent state value. | yii\authclient\BaseClient |
| restoreAccessToken() | Restores access token. | yii\authclient\BaseOAuth |
| saveAccessToken() | Saves token as persistent state. | yii\authclient\BaseOAuth |
| sendRequest() | Sends the given HTTP request, returning response data. | yii\authclient\BaseOAuth |
| setState() | Sets persistent state. | yii\authclient\BaseClient |
Property Details
Method Details
{@inheritdoc}
| public void applyAccessTokenToRequest ( $request, $accessToken ) | ||
| $request | ||
| $accessToken | ||
{@inheritdoc}
| protected void defaultName ( ) |
{@inheritdoc}
| protected void defaultTitle ( ) |
{@inheritdoc}
| protected void initUserAttributes ( ) |