Client credentials were not found in the headers or body
I know this topic is closed but would like to note a very likely solution to this that has not been mentioned. If the server is running using PHP CGI, then Auth basic headers will not get passed to PHP correctly thus causing this error.
One way to check if you pass the client_id and client_secret in the body along with the username and password and the error is not there, you need to modify your .htaccess or change native PHP module.
RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
解决方案:(此种错误只会出现在php-cgi模块时才会出现) 用原生apache-php模块 或者 添加.htaccess
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress