client-cli
client-cli copied to clipboard
Can't OAuth1 Connect
I am running this on my local VVV install:
First I ran the following command:
wp --url=http://local.vistage.dev/southwest oauth1 add
Result:
ID: 2516
Key: SXh2rc4SaIIb
Secret: nDtR5t0qgzSLU472SDN6Js8LEU0WEINkkN7BLfhyxVIJGQdu
Then I ran the following:
wp --require=client.php api oauth1 connect http://local.vistage.dev/southwest --key=SXh2rc4SaIIb --secret=nDtR5t0qgzSLU472SDN6Js8LEU0WEINkkN7BLfhyxVIJGQdu
Result:
Error: 401 Unauthorized
Im getting a Error: 400 Bad Request at the same point as @tlovett1
Any word on what's happening here? I'm getting Error: 400 Bad Request, too.
It seems it's losing the oauth parameters along the way when building the request. Can't figure out where though.
Status text on the 400 response is No OAuth parameters supplied
I tried this again and was able to authorize my application. Not sure what happened before.
Same problem here. Getting 400 response and No OAuth parameters supplied. I'm running a local apache server under Windows. HTTP_AUTHORIZATION was not being set in the global $SERVER array. In StackOverflow I found someone reporting a similar problem. http://stackoverflow.com/questions/13387516/authorization-header-missing-in-django-rest-framework-is-apache-to-blame The solution was to include a rewrite rule. RewriteCond %{HTTP:Authorization} ^(.) RewriteRule ._ - [e=HTTP_AUTHORIZATION:%1]
This has got me past the 400 No OAuth parameters supplied.
I then got the 401 Unauthorized: OAuth signature does not match
I have discovered that the client "string_to_sign" was different from the one that that server had created. The problem appears to be associated with a subdirectory install.
I made a minor change to OAuth1/lib/class-wp-json-authentication-oauth1.php replacing
$base_request_uri = rawurlencode( get_home_url( null, parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ), 'http' ) ); with
$base_request_uri = rawurlencode( $_SERVER['HTTP_REFERER'] );
And now I've finally got to the
Open in your browser: http://qw/wp40/oauth1/authorize?oauth_token=something
Hurrah!
Whether or not it's safe to use HTTP_REFERER is open for discussion. BTW. In this environment siteurl and home are: http://qw/wp40 $_SERVER['REQUEST_URI'] was /wp40/oauth1/request $_SERVER['HTTP_REFERER'] was http://qw/wp40/oauth1/request
BTW. The 401 part of this problem appears to be a duplicate of https://github.com/WP-API/OAuth1/pull/32
I have successfully installed everything, however it's not possible to finish the script as I'm seeing an "Error: 400 Bad Request" whenever I try to connect a customer.. Has anyone a solution for this?
I'm running into the same problem, just getting Error: 400 bad request. Tried everything bobbingwide mentioned with no success. Any other suggestions would be great.
Me too, I am stuck with the 400 error. I'd appreciate more information on setting the rewrite condition. I am running the client on OS X.
Trying this again today after no changes and am getting a different error, 1Could not locate OAuth information; are you sure it's enabled?`. the plugin appears active. Any suggestions?
"Could not locate OAuth information; are you sure it's enabled?" means you haven't OAuth plugin or the plugin is in detective.
Error: Could not locate API; are you sure it's enabled?
tried in 2 different wp setup, local and online
I'm sure the wp-rest-api beta2 and oauth1 plugin are installed and active i can see authentication properties in the wp-json/ response
any help please?
I am also facing the same issue. Can anyone help me asap?