I am a volunteer in a non-profit organization. I have taken over maintenance of a number of apps written in PHP/SQL/Dreamweaver. The apps are over 10 years old. I am migrating these apps from PHP/SQL to Wordpress plugins. I am now using Wordpress for authentication and set a cookie the legacy system recognizes. Some of the functions of the legacy system need to access the user list. Currently I need to maintain users in both systems. I would like to use the Wordpress REST API to access user information in Wordpress. (All user with role = instructor.) All examples of accessing the Wordpress REST API I have found involve JavaScript/Basic Authentication. (But then tell you not to use Basic Authentication.) Can anyone point me to documentation on accessing the REST API from a PHP application on the same server? Thanks

| improve this question | | | | |
  • There will be two scenarios: 1) why don't you create a backend php page that will parse data directly from WordPress mysql data base. 2) there is an official WordPress rest api but that may not help your needs exactly. Tell me which scenario you are comfortable I will proceed with that – hotheadhacker Jan 27 '19 at 16:51

After a lot of reading it appears that JWT Authentication is the best way to go. grazianodev has a good explanation of implementation at:

How to: Make JWT-authenticated requests to the Wordpress API

Thank you. My biggest concern is this answer requires the "JTW Authentication for WP REST API" plugin. I was looking for an answer that did not rely on yet another plugin. I do not understand why with an interface like REST authentication and security appear to be an afterthought and not built in at the beginning.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.