Custom WP-API Authentication
read more
Categories

Custom WP-API Authentication


The WP-API is a JSON REST API that is slated to go into WordPress core. The API allows applications like mobile apps to interact with WordPress.

It’s been written about extensively, and it’s documented well. If you’ve worked with the API before, you may have come across the issue of authentication.

The API can allow you to create a post, get information about users, and lots more. For that reason, it has to make sure you are allowed to do that. The process for figuring out who can do these things is called authentication, and it can be a pain.

The documentation on authentication is sparse, with options for cookie, oauth, or basic authentication. In this post I will show you how to create your own custom authentication.