Authentication with Client Credentials & password grant response is empty

Hi @pgr , Team

We are trying to generate access token ,

We have done all the above steps mentioned at the above url

Later configured authentication according to below url

now we are trying to get the access token using below code

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => “https://{crm_url}/Api/access_token”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “grant_type=client_credentials&client_id=dXXXXc&client_secret=8XXXXd”,
CURLOPT_HTTPHEADER => array(
“Content-Type: application/x-www-form-urlencoded”
),
));

$response = curl_exec($curl);
print_r($response);
curl_close($curl);

The response is blank …

Just an note … our crm is on vpn & can be only accessed over vpn … would that be an issue to give a response?? … however we are trying to run the above script on vpn itself.

or am I doing anything wrong? also checked out php & suitecrm logs , cant find anything there .

Please guide us we are on 7.11.10 version of suitecrm & php version 7.4.18

Thank you in advance.

Kindly ,
Sravani

Hey Team . @pgr , @p.konetskiy
Can anyone guide me on this … really stuck on this & cant move further .

Thanks in advance.

Sravani

Sorry, I’,m no good helping out with JSON API, never used it…

@sravanitedla
Sorry. I don’t see any problems with request. Maybe the problem with network configurations.

maybe caused by php 7.4? your 7.11.10 doesn’t officially support that php version.

Hey @diligent , @p.konetskiy

Thanks for your response

was able to get the access token , by re-doing the prerequisites setup.

However we would like to increase the access_token expiry time … I have searched in forum … also went through the coding level to increase the expiry time .

I dont find any clue…cant find anything to change to increase the expiry time for access token at php.ini as well

Can you please help me on this .

Thanks in advance.

Sravani