Class yii\authclient\clients\Facebook
| Inheritance | yii\authclient\clients\Facebook » 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/Facebook.php |
Facebook allows authentication via Facebook OAuth.
In order to use Facebook OAuth you must register your application at https://developers.facebook.com/apps.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'facebook' => [
'class' => 'yii\authclient\clients\Facebook',
'clientId' => 'facebook_client_id',
'clientSecret' => 'facebook_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
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. |
|---|---|---|