1 | <?php |
||
12 | class BaseProvider extends AbstractProvider |
||
13 | { |
||
14 | use BearerAuthorizationTrait; |
||
15 | |||
16 | /** |
||
17 | * Returns the base URL for authorizing a client. |
||
18 | * |
||
19 | * @return string |
||
20 | */ |
||
21 | 1 | public function getBaseAuthorizationUrl() |
|
25 | |||
26 | /** |
||
27 | * Returns the base URL for requesting an access token. |
||
28 | * |
||
29 | * Eg. https://oauth.service.com/token |
||
30 | * |
||
31 | * @param array $params |
||
32 | * @return string |
||
33 | */ |
||
34 | 3 | public function getBaseAccessTokenUrl(array $params) |
|
38 | |||
39 | /** |
||
40 | * Returns the URL for requesting the resource owner's details. |
||
41 | * |
||
42 | * @param AccessToken $token |
||
43 | * @return string |
||
44 | */ |
||
45 | 2 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
|
49 | |||
50 | /** |
||
51 | * Returns the default scopes used by this provider. |
||
52 | * |
||
53 | * This should only be the scopes that are required to request the details |
||
54 | * of the resource owner, rather than all the available scopes. |
||
55 | * |
||
56 | * @return string[] |
||
57 | */ |
||
58 | 1 | protected function getDefaultScopes() |
|
62 | |||
63 | /** |
||
64 | * Checks a provider response for errors. |
||
65 | * |
||
66 | * @throws IdentityProviderException |
||
67 | * @param ResponseInterface $response |
||
68 | * @param array|string $data Parsed response data |
||
69 | * @return void |
||
70 | */ |
||
71 | 3 | protected function checkResponse(ResponseInterface $response, $data) |
|
81 | |||
82 | /** |
||
83 | * Generates a resource owner object from a successful resource owner |
||
84 | * details request. |
||
85 | * |
||
86 | * @param array $response |
||
87 | * @param AccessToken $token |
||
88 | * @return ResourceOwnerInterface |
||
89 | */ |
||
90 | 1 | protected function createResourceOwner(array $response, AccessToken $token) |
|
94 | |||
95 | /** |
||
96 | * Returns the string that should be used to separate scopes when building |
||
97 | * the URL for requesting an access token. |
||
98 | * |
||
99 | * @return string Scope separator |
||
100 | */ |
||
101 | 1 | protected function getScopeSeparator() |
|
105 | } |
||
106 |