wp api – OAuth signature does not match

Question

I was facing a similar issue when trying to use Client-CLI with OAuth 1.0a plugin, however I found a solution here on the official repository.

In the file lib/class-wp-json-authentication-oauth1.php on line 524, change the following code:

$base_request_uri = rawurlencode( get_home_url( null, parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), 'http' ) );

to:

$home_url_path = parse_url(get_home_url (null,'','http'), PHP_URL_PATH );
$request_uri_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
if (substr($request_uri_path, 0, strlen($home_url_path)) == $home_url_path) {
    $request_uri_path = substr($request_uri_path, strlen($home_url_path));
}
$base_request_uri = rawurlencode( get_home_url( null, $request_uri_path, 'http' ) );

This should solve the problem you are facing.

0
Sudarshan Anbazhagan 9 years 2015-04-27T03:34:16-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse