Client credentials were not found in the headers or body

作者: shaneZhang 分类: 互联网技术 发布时间: 2017-06-19 20:34

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

本页面支持繁体中文友好显示:Client credentials were not found in the headers or body

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复