1 | <?php namespace Arcanedev\Socialite\OAuth\Two; |
||
11 | class LinkedInProvider extends OAuthTwoProvider |
||
12 | { |
||
13 | /* ------------------------------------------------------------------------------------------------ |
||
14 | | Properties |
||
15 | | ------------------------------------------------------------------------------------------------ |
||
16 | */ |
||
17 | /** |
||
18 | * The scopes being requested. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $scopes = ['r_basicprofile', 'r_emailaddress']; |
||
23 | |||
24 | /** |
||
25 | * The fields that are included in the profile. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $fields = [ |
||
30 | 'id', 'first-name', 'last-name', 'formatted-name', |
||
31 | 'email-address', 'headline', 'location', 'industry', |
||
32 | 'public-profile-url', 'picture-url', 'picture-urls::(original)', |
||
33 | ]; |
||
34 | |||
35 | /* ------------------------------------------------------------------------------------------------ |
||
36 | | Getters & Setters |
||
37 | | ------------------------------------------------------------------------------------------------ |
||
38 | */ |
||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | protected function getAuthUrl($state) |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | protected function getTokenUrl() |
||
54 | |||
55 | /** |
||
56 | * Get the POST fields for the token request. |
||
57 | * |
||
58 | * @param string $code |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | protected function getTokenFields($code) |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | protected function getUserByToken($token) |
||
83 | |||
84 | /** |
||
85 | * {@inheritdoc} |
||
86 | */ |
||
87 | protected function mapUserToObject(array $user) |
||
98 | |||
99 | /** |
||
100 | * Set the user fields to request from LinkedIn. |
||
101 | * |
||
102 | * @param array $fields |
||
103 | * |
||
104 | * @return self |
||
105 | */ |
||
106 | public function fields(array $fields) |
||
112 | } |
||
113 |