1 | <?php namespace Arcanedev\Socialite\OAuth\Two; |
||
11 | class LinkedInProvider extends AbstractProvider |
||
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 separating character for the requested scopes. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $scopeSeparator = ' '; |
||
30 | |||
31 | /** |
||
32 | * The fields that are included in the profile. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $fields = [ |
||
37 | 'id', 'first-name', 'last-name', 'formatted-name', |
||
38 | 'email-address', 'headline', 'location', 'industry', |
||
39 | 'public-profile-url', 'picture-url', 'picture-urls::(original)', |
||
40 | ]; |
||
41 | |||
42 | /* ------------------------------------------------------------------------------------------------ |
||
43 | | Getters & Setters |
||
44 | | ------------------------------------------------------------------------------------------------ |
||
45 | */ |
||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | protected function getAuthUrl($state) |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | protected function getTokenUrl() |
||
61 | |||
62 | /** |
||
63 | * Get the POST fields for the token request. |
||
64 | * |
||
65 | * @param string $code |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | protected function getTokenFields($code) |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | protected function getUserByToken($token) |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | protected function mapUserToObject(array $user) |
||
105 | |||
106 | /** |
||
107 | * Set the user fields to request from LinkedIn. |
||
108 | * |
||
109 | * @param array $fields |
||
110 | * |
||
111 | * @return self |
||
112 | */ |
||
113 | public function fields(array $fields) |
||
119 | } |
||
120 |