1 | <?php |
||
22 | abstract class AbstractAuthentication implements AuthenticationInterface |
||
23 | { |
||
24 | /** |
||
25 | * URI for requesting and refreshing tokens. |
||
26 | */ |
||
27 | const AUTHENTICATION_URI = 'oauth/token'; |
||
28 | |||
29 | /** |
||
30 | * HTTP Client for making authentication requests. |
||
31 | * |
||
32 | * @var ClientInterface |
||
33 | */ |
||
34 | protected $client; |
||
35 | |||
36 | /** |
||
37 | * Access token for the API. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $accessToken; |
||
42 | |||
43 | /** |
||
44 | * Client ID for the API. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $clientId; |
||
49 | |||
50 | /** |
||
51 | * Base url for the api. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $baseUrl; |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function __construct(ClientInterface $client) |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function getAccessToken() |
||
72 | |||
73 | /** |
||
74 | * Gets the value of clientId. |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getClientId() |
||
82 | |||
83 | /** |
||
84 | * Sets the value of clientId. |
||
85 | * |
||
86 | * @param string $clientId Value to set |
||
87 | * |
||
88 | * @return self |
||
89 | */ |
||
90 | public function setClientId($clientId) |
||
96 | |||
97 | /** |
||
98 | * Gets the value of baseUrl. |
||
99 | * |
||
100 | * @return mixed |
||
101 | */ |
||
102 | public function getBaseUrl() |
||
106 | |||
107 | /** |
||
108 | * Sets the value of baseUrl. |
||
109 | * |
||
110 | * @param mixed $baseUrl Value to set |
||
111 | * |
||
112 | * @return self |
||
113 | */ |
||
114 | public function setBaseUrl($baseUrl) |
||
120 | |||
121 | /** |
||
122 | * Returns the url where authentication tokens can be retrieved. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | public function getAuthenticationUrl() |
||
130 | } |
||
131 |