1 | <?php |
||
16 | class Yandex extends \SocialConnect\OAuth2\AbstractProvider |
||
17 | { |
||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 2 | public function getBaseUri() |
|
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 2 | public function getAuthorizeUri() |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 2 | public function getRequestTokenUri() |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 3 | public function getName() |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 3 | public function parseToken($body) |
|
54 | { |
||
55 | 3 | if (empty($body)) { |
|
56 | throw new InvalidAccessToken('Provider response with empty body'); |
||
57 | } |
||
58 | |||
59 | 3 | $result = json_decode($body, true); |
|
60 | 3 | if ($result) { |
|
61 | 1 | return new AccessToken($result); |
|
62 | } |
||
63 | |||
64 | 2 | throw new InvalidAccessToken('Provider response with not valid JSON'); |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
108 | } |
||
109 |