
Learn how to authenticate decoupled apps with the WordPress REST API using JWT tokens, compare basic auth and OAuth, and access protected routes tied to user roles and permissions.
Build a headless WordPress app with a local WordPress site and a JavaScript front end, loading posts via the REST API. Log in to enable creating, editing, and deleting posts.
Install and activate a WordPress JWT plugin, configure htaccess rules for hosting, set the JWT secret key in wp-config, enable cross-origin requests, and test authentication via the API root.
Begin with the starter javascript app, review config, helpers, and state patterns, and learn how to run and inspect the app as you prepare to add WordPress REST API authentication.
Create a dynamic header that pulls the WordPress rest API site name and site description with X-ers and token-based auth, then initialize from index.js to render state.
Learn to fetch WordPress posts via the REST API, limit results to five, store them in state, and render them on the page with interactive links.
Learn to display a single post from state when a post is clicked, showing full content with a back button and no extra API calls.
Set up authentication for a headless WordPress REST API by implementing a JavaScript authentication flow using the WordPress JWT plugin, handling tokens with cookies, and building login/logout logic.
Add a login form to the app that captures username and password and passes credentials to the authentication flow, with dynamic rendering, event handling, and config-driven ids.
Build a dynamic logout form for a headless WordPress REST API setup, manage login state and tokens, and enable conditional rendering for authenticated requests.
Add a quill editor to a decoupled WordPress page and wire up login/logout controls, enabling content creation. Save posts via the WordPress REST API using a token-based authorization header.
Set up in-app notices to display quick messages after actions like save, login, update, or logout, using a render function and config-driven message types.
Add edit links to posts, load the selected post's title and content into an authenticated editor, and save updates with a PUT to the post ID.
Learn to delete content via the headless WordPress REST API by adding a delete post link, confirming the action, authenticating with a token, and refreshing the post list.
Explore decoupled authentication with the WordPress REST API using JWT, set up WordPress with the JWT plugin, create login/logout flows, and perform authenticated CRUD on posts, pages, and more.
Many developers and top agencies have learned how to use WordPress as a headless CMS, where WordPress stores the content, but Modern JavaScript driven websites and applications display the content and provide customized interactivity.
One of the key components to using WordPress as a Headless CMS involves authenticating to allow full read, write and delete access to everything the WordPress REST API provides.
In this course you will learn the following:
The different types of authentication available
How to work with the JWT Authentication Standard
How to setup WordPress to offer authentication
How to write secure JavaScript to authenticate
How to build login and logout forms
How to add, edit and delete content using authenticated WordPress REST API calls
Throughout the course we will build a custom decoupled project using simple JavaScript, but all of the code can be easily converted over to work with React, Vue, Angular and other JavaScript frameworks.