Hello, I am attempting to update to the OAuth from the JWT and ran into a problem. I have created a server-to-server-oauth app and have the keys. I can retrieve a token but when I try to use the token, it returns the error, “This API does not support client credentials for authorization.”
From what I can find in the forums, I need to change the grant type from “client_credentials” to “account_credentials”. However, that returns “invalid request”
This is in PHP, and I am using the package “league/oauth2-client” to get the token.
I am attempting to salvage the existing code base which uses Guzzle, and get a token and attach that to the Guzzle requests.
The code is rather simple,
$provider = new \League\OAuth2\Client\Provider\GenericProvider(
[
‘clientId’ => ‘…’, // The client ID assigned to you by the provider
‘clientSecret’ => ‘…’, // The client password assigned to you by the provider
‘redirectUri’ => ‘’,
‘urlAccessToken’ => ‘https://zoom.us/oauth/token’,
]);
I wasn’t able to get postman to make a successful token request. It just keeps giving an error, "Invalid redirect: https://oauth.pstmn.io/v1/callback (4,700) " that I was not able to find a solution for.
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://zoom.us/oauth/token');
curl_setopt($curl, CURLOPT_POST, true);
$data = array(
'grant_type' => 'account_credentials',
'account_id' => $account_id
);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
// $r is base_64encode string... I was not able to make it work If I actually put an array for the
authorization header it would fail but if it did it like this it worked
$headers = array(
'Host' => 'zoom.us',
"Authorization: Basic $r"
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
var_dump($response);
curl_close($curl);