osms-php icon indicating copy to clipboard operation
osms-php copied to clipboard

Upgrate Oauth to v3

Open MohamedSR opened this issue 5 years ago • 0 comments

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;
}

MohamedSR avatar Feb 03 '21 12:02 MohamedSR