-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App requests to /wp-json/users/me are failing. #45
Comments
Hi, same for me with my own Aouth. here is the return body But i can create posts with the same Aouth system |
Closing this. |
If you need to work around this, you can also try adding |
Ahah! That works too. thx!
|
Please refer to this comment on WP-API : WP-API/WP-API#493 (comment)
I have successfully built and tested a PHP OAuth client to go through the authentication flow and then GET /wp-json/users/me to verify the user. This all works fine. (Note this only works when PHP cUrl CURLOPT_FOLLOWLOCATION is false - the default.)
But when I try a native mobile app (in this case iOS built using Appcelerator Titanium), I can go through the authentication flow fine, then collect an access_ token/secret pair, but the final /wp-json/users/me GET request signature never matches.
Lots of debugging and logging has shown that the client is being sent on a 2nd GET request to
/wp-json/users/<ID>
with the same parameters detected inget_parameters()
from the original request. Therefore, the signatures don't match, as the REQUEST_URI is now different for the base string creation.Removing
$response->set_status( 302 );
fromclass-wp-json-users.php
in WP-API seems to fix this.The text was updated successfully, but these errors were encountered: