osms-php
osms-php copied to clipboard
Upgrate Oauth to v3
As recommended by OD please upgrate Oauth to v3
public function getTokenFromConsumerKey()
{
$url = self::BASE_URL . '/oauth/v3/token';
$credentials = $this->getClientId() . ':' . $this->getClientSecret();
$headers = array('Authorization: Basic ' . base64_encode($credentials));
$args = array('grant_type' => 'client_credentials');
$response = $this->callApi($headers, $args, $url, 'POST', 200);
if (!empty($response['access_token'])) {
$this->setToken($response['access_token']);
}
return $response;
}