Ok, so technically I didn’t solve the issue that prevented me from accessing posts in draft
status from an external domain where the frontend is hosted using only nonce
values. My guess is that the logged_in
cookie was not set/could not be read on the frontend side to verify the nonce
value during an external AJAX request.
That being said, I installed the JWT Authentication for the WP REST API plugin (https://github.com/Tmeister/wp-api-jwt-auth) and now require admins to login once on the frontend preview page to set the token in local storage.
Related Posts:
- Log in user using WordPress REST API
- WordPress Rest API: How do we validate with our custom API key?
- authentication issue with rest api – rest_cannot_create
- WP REST API: check if user is logged in
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Passing a borrowed nonce through Postman fails
- WP REST API – Nonce passes wp_verify_nonce even after logout
- Rest API: wp_verify_nonce() fails despite receiving correct nonce value
- How to connect android app with WordPress website?
- How to verify which WordPress user requested the API in ASP .NET Core?
- wp_nonce vs jwt
- Register rest field authentication with REST API
- How to: Make JWT-authenticated requests to the WordPress API
- How do I create a user using the new JSON api in 4.7?
- WordPress REST API call generates nonce twice on every call
- How to Authenticate WP REST API with JWT Authentication using Fetch API
- wordpress wp-json prefix issue
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Can I authenticate with both WooCommerce consumer key and JWT?
- Android authentication
- How to login to WordPress site using basic authentication HTTP headers?
- Can we access the REST request parameters from within the permission_callback to enforce a 401 by returning false?
- Rest API authentication issue when called from fetch request in bundle.js
- Formating content rendered from wordpress REST API as JSON and not HTML
- Create Session with JWT
- Full page NGINX (or Cloudflare) caching and WordPress nonces
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- WordPress REST API – Modify JSON before importing
- Why does AWStats show /wp-json* as Viewed URLs
- how to send Ajax request in wordpress backend
- permission_callback has no effect
- WP REST API GET Requests require authentication
- current_user_can(‘administrator’) returns false when I’m logged in
- Authenticating with REST API
- Make authorization mandatory on custom routes
- How to order WordPress Rest API data
- WP Rest API – How to convert embedded to json object in Java [closed]
- featured image not found in json from wp rest api
- How to save generated JWT token to cookies on login?
- SSO autologin WordPress + Ajax
- How to force JWT auth for default GET endpoints of WordPress rest api?
- Custom endpoint to get all custom taxonomy terms
- WordPress JSON data to and from database to be shown on rest point
- REST API: best place to set current user for JWT auth?
- How to Get Featured Image from REST API?
- WordPress + REST API v2 and private pages Load by slug
- REST API authentication for a plugin
- PHP: authenticate for a REST request?
- Rest API basic auth not working
- If I use WordPress REST API V2 and someone makes an app using it. Will my site count the posts views from the APP? And if not, then how?
- Authenticate current user to REST API
- Getting 401 from ajax using an application password
- WordPress REST API calls that depend on the WordPress User
- Custom WP API endpoint NULL body data
- Backbone with custom rest endpoints
- WordPress HTTP API NTLM Authentication
- Advanced Access Manager: RESTful endpoint to refresh token
- Is there a way I can fetch the WordPress Developer Code References with an API?
- Best Authetication between REST API and Mobile App
- 403 error when publishing a post in wordpress. Error => Publishing failed. The response is not a valid JSON response
- Error message: Response is not a valid JSON response
- WordPress REST API not working on localhost
- DELETE request using WP REST API
- Secure WordPress API, how?
- register/login api
- how to create JSON array [] for REST response?
- WP Rest API in Android studio does not show Images
- What’s the right way to validate JSON data coming from an AJAX POST request?
- How do i POST to WordPress rest API from the same domain?
- How to receive JSON payload from a digital device
- WP CLI in WP 5.3 with PHP 7.4
- Get wordpress post with featured image, category and tag from WordPress API
- WordPress API “code”:”rest_no_route” with Custom Route
- The same session information for peer users on two different WordPress servers
- How can I secure my custom rest api endpoint or add under a already existing rest group
- Autotrader API Integration
- REST API get featured image source for custom post type
- Fix Characters WordPress Ionic App
- Display Post Featured Image along with Categories via WP Rest API
- WordPress REST API not displaying all information
- REST API Integration without user account?
- WordPress Rest API Escapes Returned URLs Forward Slash
- WP REST API with Basic Auth at target website
- Custom WP Rest API Endpoints from JSON Schema
- Cant POST with REST API on WordPress
- Custom rest api endpoint response json problem
- REST API – Authentication/Logon security
- WordPress json – How to use the content rendered from json
- Rest Api WordPress
- Rest API nonce is being cached
- custom REST endpoints and application passwords
- wordpress rest api authentication failed
- Getting user meta data from WP REST API
- how to authenticate for the REST API from a plugin and from command line
- Get all PDF files from page with WordPress API
- /wp-json/wp/v2/posts/?app=3 is returning random scripts tags
- Get html from custom route api
- How to use WordPress rest API with Angularjs 4 [closed]
- How to change WordPress api v2
- WordPress REST API won’t allow me to filter by author ID when called internally, works externally in Postman