Open gzroy2015 opened 6 years ago
在这里有人也提出类似问题 https://github.com/bshaffer/oauth2-server-php/issues/531
解决方法: client.php
$client = new GuzzleHttp\Client();
$response = $client->request('POST', SERVER_URL.'/token.php', [
'auth' => [CLIENT_ID, CLIENT_SECRET],
'form_params'=> [
'grant_type'=>'authorization_code',
'code'=> $code,
'redirect_uri'=> REDIRECT_URI,
'client_id'=>CLIENT_ID,
'client_secret'=>CLIENT_SECRET,
]
]);
Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error:
POST http://oauth2-server.dev/token.php
resulted in a400 Bad Request
response: {"error":"invalid_client","error_description":"Client credentials were not found in the headers or body"} '