0

Hi everyone and thank you in advance for reading the question and helping me out.

I amb building with a friend an app that uses a custom self-made PHP-MySQL API to be cross-platform. Everything in the app works thanks to that API but we need users to be controlled by an external WP. WP and API are in different sub-domains and servers.

So we have: WP (for users) + API (for functionalities and data) + Apps (UIs).

Users write it's credentials in the App and that credentials go to our own API and here is where I doubt how should I use those credentials to log in into WP. The same happends to register. Those two functionalities need to be handled by WP and I don't know which of this 2 options is best:

Option 1: Create another mini-api for WP with wp_create_user() and others needed and call from the main API to the mini-api for WP to regiser / login

Option 2: Use WP Rest API to authenticate and register. The problem with that option is that all the examples that I have seen were web-based and I need to implement it with no grafic interfice to call it from my PHP API.

Response needed: In any case the only answer I need from WP is the wp_user id.

PD: Sorry for my poor english, it's not my native language

-1

Option 1: Why create your own WordPress API (mini or not) when you already have one?

Option 2: You should try to extend the WordPress REST API in order to register/authenticate. You can use, e.g. https://es.wordpress.org/plugins/json-api-user/ or just grab from it the code you need and modify it.

  • Thank you very much David! That plugin seems to have everything I need! – user1831622 Dec 21 '16 at 11:06

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.