1 | <?php |
||
11 | class HeadHunter extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $urlApi = 'https://api.hh.ru'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $urlAuthorize = 'https://hh.ru/oauth/authorize'; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $urlAccessToken = 'https://hh.ru/oauth/token'; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $state; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $redirectUri; |
||
39 | |||
40 | /** |
||
41 | * @inheritDoc |
||
42 | */ |
||
43 | 1 | public function getBaseAuthorizationUrl() |
|
47 | |||
48 | /** |
||
49 | * @inheritDoc |
||
50 | */ |
||
51 | 3 | public function getBaseAccessTokenUrl(array $params) |
|
60 | |||
61 | /** |
||
62 | * @inheritDoc |
||
63 | */ |
||
64 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
65 | { |
||
66 | return $this->urlApi.'/me?'. |
||
67 | $this->buildQueryString([ |
||
68 | 'access_token' => (string) $token, |
||
69 | ]); |
||
70 | } |
||
71 | |||
72 | /** |
||
73 | * @inheritDoc |
||
74 | */ |
||
75 | 1 | protected function getDefaultScopes() |
|
76 | { |
||
77 | 1 | return []; |
|
78 | } |
||
79 | |||
80 | /** |
||
81 | * @inheritDoc |
||
82 | */ |
||
83 | 1 | protected function getAuthorizationParameters(array $options) |
|
98 | |||
99 | /** |
||
100 | * @inheritDoc |
||
101 | */ |
||
102 | 2 | protected function checkResponse(ResponseInterface $response, $data) |
|
108 | |||
109 | /** |
||
110 | * @inheritDoc |
||
111 | */ |
||
112 | protected function createResourceOwner(array $response, AccessToken $token) |
||
116 | } |
||
117 |