Class yii\authclient\clients\LinkedIn
Inheritance | yii\authclient\clients\LinkedIn » 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/LinkedIn.php |
LinkedIn allows authentication via LinkedIn OAuth.
In order to use linkedIn OAuth you must register your application at https://www.linkedin.com/secure/developer.
Example application configuration:
'components' => [
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'linkedin' => [
'class' => 'yii\authclient\clients\LinkedIn',
'clientId' => 'linkedin_client_id',
'clientSecret' => 'linkedin_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
List of attribute names, which should be requested from API to initialize user attributes.
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. |
Composes user authorization URL.
string buildAuthUrl( array $params = [] ) | ||
$params | array | Additional auth GET params. |
return | string | Authorization URL. |
---|
Generates service name.
string defaultName( ) | ||
return | string | Service name. |
---|
Returns the default $normalizeUserAttributeMap value.
Particular client may override this method in order to provide specific default map.
array defaultNormalizeUserAttributeMap( ) | ||
return | array | Normalize attribute map. |
---|
Composes default $returnUrl value.
string defaultReturnUrl( ) | ||
return | string | Return URL. |
---|
Generates service title.
string defaultTitle( ) | ||
return | string | Service title. |
---|
Fetches access token from authorization code.
yii\authclient\OAuthToken fetchAccessToken( $authCode, array $params = [] ) | ||
$authCode | string | Authorization code, usually comes at $_GET['code']. |
$params | array | Additional request params. |
return | yii\authclient\OAuthToken | Access token. |
---|
Generates the auth state value.
string generateAuthState( ) | ||
return | string | Auth state value. |
---|
Initializes the object.
This method is invoked at the end of the constructor after the object is initialized with the given configuration.
void init( ) |
Initializes authenticated user attributes.
array initUserAttributes( ) | ||
return | array | Auth user attributes. |
---|