This is how I did it, but I feel it could be better. For one thing, this results in HTTP 500… 403 would be preferable
add_filter( 'json_authentication_errors', function( $authenticated ) {
if( !$authenticated ) {
return new WP_Error('Access Denied');
}
}, 99 );
(I understand this’ll work for Basic Auth too)
Related Posts:
- What is the OAuth 2.0 Bearer Token exactly?
- Sign in with Google temporarily disabled for this app
- “An access token is required to request this resource” while accessing an album / photo with Facebook php sdk
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- Implement authentication to an organization oAuth server
- OAuth1 empty “authentication” in /wp-json
- WP – API – OAuth 1.0a Server, How to implement with AngularJS?
- oAuth2 Authentication in WordPress using WP OAuth Server and WP API plugins
- Constructing requests with URL Query String in Python
- localhost/phpinfo.php
- Facebook OAuth “The domain of this URL isn’t included in the app’s domain”
- Discord OAuth2 redirect URI how-to
- Hiding WordPress REST API v2 endpoints from public viewing
- Get WP Navigation Menu from REST API V2
- WP-API v2 Custom Endpoint Response Formatting
- Implementing Isomorphic JavaScript (React JS) in WordPress?
- WP API returning SQL results as strings, rather than numbers
- wp rest api v2 return json_no_route
- Retrieving pages with multiple tags using REST API
- WP-REST API not returning all its endpoints, 404 on documented endpoints
- WordPress Rest API: How do we validate with our custom API key?
- How to loop through JSON data in wordpress WP REST API
- WP API V2 returning Invalid User ID
- Hiding API routes list
- Get more than 10 posts in a specific category with the wordpress api
- OAuth signature does not match
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Keep getting 401 error from WordPress on AWS Lightsail
- Extending wp JavaScript base class to make a post request to a custom REST endpoint
- node-wpapi: how to handle authentication?
- React post to WordPress custom post type
- Post body not working with wp_remote_post()
- PHP Fatal error: Cannot use object of type WP_REST_Response as array in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- WP Rest API get page from path
- Where to store OAuth 2.0 client id and secret?
- WP REST API GET Requests require authentication
- Allow logged in WordPress user to access 3rd party Laravel API via OAuth
- WP REST API – reading custom post type
- Create a custom post with custom post-metadata with WP API
- For using google api is it necessary to install the google client libraries for using Oauth 2 in wordpress installation?
- Use the backbone.js client to save custom post type meta
- Erratic OAuth 1.0 Signature Mismatch Errors
- Get non-rendered content from WP-API
- No ‘Access-Control-Allow-Origin’ when call rest API
- Redirect URL on OAuth2.0 after switching from http to https
- Custom Post Type not showing in Rest API on Multisite
- Syntax for REST API to have bold formatted and multiple lines in product description [closed]
- Add Data to Response of WP-JSON Root
- Authorizing a plugin to call Google Analytics v4 API on wp_cron
- Faceted search with WP-API data
- WP OAuth Server “The grant type was not specified in the request”
- OAuth Plugin Produces Error With Yahoo
- rest_no_route on custom API endpoint wordpress
- WordPress API for custom post types returns rest_no_route
- WP REST API – get custom taxonomies based on terms & filter
- WP API and Proxy
- WP REST API. Configuring JSON routes
- why woocommerce api only do not upload images from local computer? [closed]
- How can I spin up a new website for a registered user automatically?
- WordPress REST Api get posts by ID
- Creating a WordPress Post via REST API – HTML or Markdown?
- How to run wp cli from a wp hook?
- How to use Python to create a Post in WordPress?
- update_callback is not working in register_rest_field
- What WP-API authentication method should I use to interact with anonymous / not-logged visitors?
- Best way to retrieve data in custom api extended from wp-api
- Is WP API going to be around in the long term?
- Outputting HTML elements through WP-API
- How to make an API call to a custom post type but filtering by meta value?
- Cannot use WordPress Application Passwords: “code”: “rest_no_route” “status”:404 for /wp-json/wp/v2/users/me/application-passwords
- Check if user can in javascript
- Get a complete list of all categories using node-wpapi
- WP-API call function
- Escape commas in REST API
- WordPress REST API in Integromat: How to overcome “Sorry, you are not allowed to list users / edit this…”
- CallBack URL for payment gateway redirecting to homepage instead of executing callback function
- Adding Amchart Interface to WordPress API
- Deleting media using the WordPress Rest API
- Create Posts from API response without duplicates
- WP-API Content showing null
- Extending the API I created to return category names
- How to properly set a value to meta fields of a custom post type in WP-API/node-wpapi REST API?
- How do WordPress plugins work with oAuth2 APIs?
- Fetch only categorized posts
- Best Way to detect unique posts in wp rest api
- WP-API + JS Backbone client – how to update post meta
- WP-API : post_meta not updated… but have another entry
- Implement OAuth2 in custom plugin
- External api call using wordpress
- Custom post type REST api 404: Updating failed. No route was found matching the URL and request method
- Adding Microsoft Teams Incoming Webhook to WordPress, Problem with Rest Route?
- Woocommerce API for calling products by Category ID
- wordpress rest api authentication failed
- How to submit a button automatically after every scheduled hours?
- i need to resive data external api and show user
- list all gutenberg blocks properties with icon name as well
- Transmit headers and footers via API from one site to another
- WordPress getting data from external API
- Trying to create and update wordpress from python library
- How to invalidate wordpress_logged_in cookie via backchannel logout