Closed TomasKulhanek closed 6 years ago
The error "invalid_client" reported to Instruct.
Reproduced with index.php and refreshToken.php demo documented in http://aria.structuralbiology.eu/docs.html therefore it seems that our implementation follows correct workflow.
OK, this was an issue with PHP7 not allowing credentials in the body of a request. If you send your client id and secret as HTTP headers, it works correctly.
I’ve updated our documentation at: http://aria.structuralbiology.eu/docs.html but basically, you need to change the $OApacket to:
$OApacket = array(
'grant_type' => 'authorization_code',
'code' => urlencode($code)
);
And pass the credentials as:
curl_setopt( $ch, CURLOPT_USERPWD, $client_id .':'. $client_secret );