1 | <?php |
||
16 | class Bitbucket 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 | 3 | public function parseToken($body) |
|
51 | { |
||
52 | 3 | if (empty($body)) { |
|
53 | throw new InvalidAccessToken('Provider response with empty body'); |
||
54 | } |
||
55 | |||
56 | 3 | $result = json_decode($body, true); |
|
57 | 3 | if ($result) { |
|
58 | 1 | return new AccessToken($result); |
|
59 | } |
||
60 | |||
61 | 2 | throw new InvalidAccessToken('Server response with not valid/empty JSON'); |
|
62 | } |
||
63 | |||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | 1 | public function getIdentity(AccessTokenInterface $accessToken) |
|
101 | } |
||
102 |