1 | <?php |
||
19 | abstract class AbstractAuthentication implements AuthenticationInterface |
||
20 | { |
||
21 | /** |
||
22 | * URI for requesting and refreshing tokens. |
||
23 | */ |
||
24 | const AUTHENTICATION_URI = 'oauth/token'; |
||
25 | |||
26 | /** |
||
27 | * HTTP Client for making authentication requests. |
||
28 | * |
||
29 | * @var ClientInterface |
||
30 | */ |
||
31 | protected $client; |
||
32 | |||
33 | /** |
||
34 | * Access token for the API. |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $accessToken; |
||
39 | |||
40 | /** |
||
41 | * Client ID for the API. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $clientId; |
||
46 | |||
47 | /** |
||
48 | * Base url for the api. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | protected $baseUrl; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | public function __construct(ClientInterface $client) |
||
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | public function getAccessToken() |
||
69 | |||
70 | /** |
||
71 | * Gets the value of clientId. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function getClientId() |
||
79 | |||
80 | /** |
||
81 | * Sets the value of clientId. |
||
82 | * |
||
83 | * @param string $clientId Value to set |
||
84 | * |
||
85 | * @return self |
||
86 | */ |
||
87 | public function setClientId($clientId) |
||
93 | |||
94 | /** |
||
95 | * Gets the value of baseUrl. |
||
96 | * |
||
97 | * @return mixed |
||
98 | */ |
||
99 | public function getBaseUrl() |
||
103 | |||
104 | /** |
||
105 | * Sets the value of baseUrl. |
||
106 | * |
||
107 | * @param mixed $baseUrl Value to set |
||
108 | * |
||
109 | * @return self |
||
110 | */ |
||
111 | public function setBaseUrl($baseUrl) |
||
117 | |||
118 | /** |
||
119 | * Returns the url where authentication tokens can be retrieved. |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getAuthenticationUrl() |
||
127 | } |
||
128 |