h2020-westlife-eu / wp6-repository

https://h2020-westlife-eu.github.io/wp6-repository/
MIT License
0 stars 0 forks source link

ARIA integration, request on auth token fails on "invalid_client" #21

Closed TomasKulhanek closed 6 years ago

TomasKulhanek commented 6 years ago
TomasKulhanek commented 6 years ago

The error "invalid_client" reported to Instruct.

TomasKulhanek commented 6 years ago

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.

TomasKulhanek commented 6 years ago

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