register/login api

Is there support out of the box for this in WordPress or do you need to create a custom route etc? No, there is no endpoint for user login and registration. You would need to install an authentication plugin designed for remote auth such as the OAuth2 plugin, or wait until 5.6 adds application passwords. … Read more

Force REST API Authentication for each request method

You can’t really apply authentication based directly on whether the request is GET or otherwise, but can forcefully apply authentication requirements globally in that manner, if you like. I’ve been quite verbose with the code to illustrate what’s happening: add_filter( ‘rest_authentication_errors’, function ( $error ) { /** * If it’s a WP_Error, leave it as … Read more

wp_nonce vs jwt

What I haven’t thought of is that I could use wp_nonce instead of jwt – create nonce on backend, store it on frontend and send it with every request till it expires. What drawbacks does wp nonce method have vs jwt method? Using nonces as a replacement for an authentication protocol, or as a session … Read more

File not found.