0
votes

We would like our customers inside our WordPress WooCommerce instance to be able to authenticate using their login with an external app we are building. Looking at the WooCommerce REST API Documentation it doesn't seem it provide any methods.

How else could this be achieved. My thoughts:

  1. Query account table in WooCommerce every 15 mins and if new user comes along create them an account in the external system with a separate password.

We would much prefer for the users to be able to authenticate with their existing accounts otherwise the method (or similar) above would need to be implemented.

1

1 Answers

0
votes

I was able to solve this issue with the JWT Authentication plugin. Each customer is saved into your WordPress Users module with a type of Customer. Utilising the Login API in WP Core we are able to identify if the users have passed the authentication as it will provide back a token.

For example, this is how our request will appear: curl https://example.com/wp-json/jwt-auth/v1/token?username=app-demo&password=example