I am making cordova/phonegap project that is interacting with WP site. dealing with posts, comments .. etc.
I installed JSON REST API plugin for fetching posts from WP sites.
But some endpoints of JSON API required Authentication. such as ( create new post, create new comments.. )
But I don’t know how to authenticate for wordpress site.
So I’ve read this reference.
What client_id is this?
How do I get this?
client_id should be set to your applicationâs client ID as found in the applications manager.
What’s “my application”‘s meaning?
Why does it authenticate from this URL instead of my domain?
https://public-api.wordpress.com/oauth2/authorize?
I am really confused.
Can anybody help me?
Yes, I was also confused. But there is a better explanation here:
https://github.com/WP-API/api-console
Basically you need to run few lines on the server (Step 1), so Key and Secret will be your client_key and client_secret. If you’ll finish what they say you can use them in the future.
Unfortunately I do not have opportunity to try it by myself because I don’t have access to the server. Hope it helps!
Although this may not exactly answer the question, it might provide a lead. I used xmlrpc to communicate to register and login both of which yield a WP userid.
Cordova code:
xmlrpc.php
and in functions.php on wordpress child theme: