Creating Application Password using REST API results in 401 regardless of JWT token

Because what you’re trying to do boils down to the fundamental question: How do I log in to WordPress using only the REST API? The answer: You can’t in stock/vanilla WordPress. /wp-json/wp/v2/users/me/application-passwords/ “message”: “You are not currently logged in.”, and /wp-json/wp/v2/users/1/application-passwords/ “message”: “Sorry, you are not allowed to create application passwords for this user.”, Are … Read more

custom REST endpoints and application passwords

If you want to use application passwords to authenticate requests to your RESTful endpoints, you can modify your permission_callback function to check for the presence and validity of an application password instead of a user’s credentials. To do this, you can use the wp_check_application_passwords function, which was introduced in WordPress 5.6. This function takes an … Read more