Class yii\authclient\clients\YandexOAuth
Inheritance | yii\authclient\clients\YandexOAuth » yii\authclient\OAuth2 » 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/YandexOAuth.php |
YandexOAuth allows authentication via Yandex OAuth.
In order to use Yandex OAuth you must register your application at https://oauth.yandex.ru/client/new.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'yandex' => [
'class' => 'yii\authclient\clients\YandexOAuth',
'clientId' => 'yandex_client_id',
'clientSecret' => 'yandex_client_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
Performs request to the OAuth API.
array apiInternal( $accessToken, $url, $method, array $params, array $headers ) | ||
$accessToken | yii\authclient\OAuthToken | Actual access token. |
$url | string | Absolute API URL. |
$method | string | Request method. |
$params | array | Request parameters. |
$headers | array | Additional request headers. |
return | array | API response. |
---|---|---|
throws | yii\base\Exception | on failure. |
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. |
---|