Wordpress login API Rest

Asked

Viewed 545 times

1

I have a client who uses Woordpress and WooCommerce, and I have to make a mobile app from his online store, my problem is in the customer’s LOGIN.

I looked at several API Rest of developers and none have the user login, I mean I will have to do this at hand. My biggest problem now is that I don’t know how to make this Rest service accessible through a URL for example:

minhaloja.com.br/api/usuario 

This page has to be created in the plugin installation.

Does anyone have any idea?

  • Have you searched the WP REST API? http://v2.wp-api.org/ has yes authentication.

  • Hi Ricardo, I had searched, but it was 3:00 in the morning and I didn’t see this link, I went kind of straight to GIT. I’ll take a look. Thanks.

  • So Ricardo, I need a service that send login and password and he returns me if there is customer data and if there is no false, but I do not think this.

  • Client login is a Wordpress user login?

  • A possible way would be to try to access any API, which requires authentication; if the user is not authenticated, must give error 403, or similar thing.

  • Yes, the client is a Wordpress user(Woocommerce clients). I found two plugins here that solve my problem are they: JSON API and JSON API USER accessing looks like this: http://localhost/Apps/wordpress/api/user/generate_auth_cookie/? username=admin&password=admin&insecure=cool. In a way, does anyone know how to do that? A way for me to create a url and this url does not fall on the "page not found" of WP?

Show 1 more comment

1 answer

0

Cara.. for you to authenticate in wordpress via the api you will be able to do in some ways..

  1. Cookie Authentication
  2. Oauth Authentication
  3. Basic Authentication (if you don’t need a very high level of security)
  4. JWT Authentication

Taking the first one out of the rest you’ll need to install plugins.. Just quickly search the google you find.

I advise you to use JWT.. is easy to understand and has a good level of security.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.