1 | <?php |
||
19 | class Odnoklassniki extends \SocialConnect\OAuth2\AbstractProvider |
||
20 | { |
||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 2 | public function getBaseUri() |
|
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 2 | public function getAuthorizeUri() |
|
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 2 | public function getRequestTokenUri() |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 3 | public function getName() |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 3 | public function parseToken($body) |
|
57 | { |
||
58 | 3 | if (empty($body)) { |
|
59 | throw new InvalidAccessToken('Provider response with empty body'); |
||
60 | } |
||
61 | |||
62 | 3 | $result = json_decode($body, true); |
|
63 | 3 | if ($result) { |
|
64 | 1 | return new AccessToken($result); |
|
65 | } |
||
66 | |||
67 | 2 | throw new InvalidAccessToken('Provider response with not valid JSON'); |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @link https://apiok.ru/dev/methods/ |
||
72 | * |
||
73 | * @param array $requestParameters |
||
74 | * @param AccessTokenInterface $accessToken |
||
75 | * @return string |
||
76 | */ |
||
77 | 1 | protected function makeSecureSignature(array $requestParameters, AccessTokenInterface $accessToken) |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
138 | } |
||
139 |