Best way to authenticate WP REST API requests from a mobile app
-
Our organization currently has a robust webapp that leverages the WP REST API v2. Most of our site front-end already communicates with the wordpress core and our custom functions using this interface, and authentication of such requests is easy using the built in cookie authentication. Now we want to build a mobile app that replicates some of the webapp functions, and adds a few more features, and it seems the most logical development route to use the REST interface we already having running.
My question is this: what’s the best way to authenticate the RESTful requests? Even though our site is on HTTPS, it seems like bad practice to send the username and password with every request. I thought about creating my own authentication method by sending the user’s username/password to the server, the server returns a key, and that key is used in each REST request, but that seems as bad as sending the username and password – because it would still give anyone who intercepted the key full access to a user’s account over REST.
So what’s the safest way to handle authentication of REST API requests from an untrusted third-party?
- The topic ‘Best way to authenticate WP REST API requests from a mobile app’ is closed to new replies.