You could hook into the login process in the WP site and create a unique token (stored in meta) for that user on login. The token can then be sent to the other server, that could query the WP API with that token.
You would have to create a custom endpoint that validates the user token. Probably best to have some hash for the userid also.
Furthermore, on logout from the WP site or in some token validation cronjob, this token has to be invalidated for security purpose. Even better, if it’s just one request from the ‘other’ server, invalidate immediately and if on the WP server again, create a new token. So in effect, it’s a CSRF token (nonce) over multiple servers.
Related Posts:
- How to: Make JWT-authenticated requests to the WordPress API
- WordPress Rest API: How do we validate with our custom API key?
- How to Authenticate WP REST API with JWT Authentication using Fetch API
- authentication issue with rest api – rest_cannot_create
- Can I authenticate with both WooCommerce consumer key and JWT?
- WP REST API: check if user is logged in
- 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?
- WordPress REST API “rest_authentication_errors” doesn’t work external queries?
- Can’t GET draft posts via REST API from headless frontend
- Create Session with JWT
- 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
- WP REST API – Nonce passes wp_verify_nonce even after logout
- How to force JWT auth for default GET endpoints of WordPress rest api?
- REST API: best place to set current user for JWT auth?
- 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
- Authenticate current user to REST API
- Rest API: wp_verify_nonce() fails despite receiving correct nonce value
- Getting 401 from ajax using an application password
- How to connect android app with WordPress website?
- WordPress HTTP API NTLM Authentication
- Advanced Access Manager: RESTful endpoint to refresh token
- Best Authetication between REST API and Mobile App
- Log in user using WordPress REST API
- Secure WordPress API, how?
- wp_nonce vs jwt
- register/login api
- How can I secure my custom rest api endpoint or add under a already existing rest group
- Register rest field authentication with REST API
- REST API Integration without user account?
- WP REST API with Basic Auth at target website
- Cant POST with REST API on WordPress
- REST API – Authentication/Logon security
- custom REST endpoints and application passwords
- wordpress rest api authentication failed
- How to add additional http header to a wp_error rest response
- Is the WordPress REST API installed and enabled in a vanilla WordPress 4.7 installation?
- Does something like is_rest() exist
- How to use OAuth authentication with REST API via CURL commands?
- REST API purpose?
- Get post count in wp rest API v2 and get all categories
- WP REST API — How to change HTTP Response status code?
- wp_get_current_user() function not working in Rest API callback function
- How to use WP-REST API to login user and get user data for Android app?
- WP REST API Is it rather easy to rename the default wp-json uri part?
- Search WP API using the post title
- check the requesting url
- How would I add custom tables/endpoints to the WP REST API?
- WP REST API Require Password for GET Endpoint
- Displaying a page built with Elementor using the REST API [closed]
- Getting user meta data from WP REST API
- Understanding SHORTINIT with WordPress 5
- How to use _embed when using _fields?
- WordPress REST API – Permission Callbacks
- WP REST API V2 – Retrieve sub page by full slug (URL/Path)
- WP REST API create post authentication issue
- Why is my custom API endpoint not working?
- WordPress REST API validation
- Are there server performance benefits to fetching only specific fields when querying the REST API?
- How to define a query parameter with REST API?
- Filter posts by multiple custom taxonomy terms using AND operator in REST API v2 (WordPress)
- WP REST API returns blank response if post is too long
- How do I correctly setup an AJAX nonce for WordPress REST API?
- how to authenticate for the REST API from a plugin and from command line
- How to check WordPress website username and password is correct
- Increase per_page limit in REST API
- Does pre_get_posts affect REST API responses?
- How to feed a HTML5’s EventSource with a REST API custom endpoint?
- How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?
- Adding WordPress API Endpoint With Multiple Parameters
- How to authenticate custom API endpoint in WooCommerce [closed]
- WordPress REST API call generates nonce twice on every call
- Retrieve CSS and JS From the REST API
- Using the REST API (v2) javascript client on a private namespaced route
- WP REST API core major changes
- WordPress 4.7 REST API endpoints
- How to get all posts from parent and children categories?
- wordpress wp-json prefix issue
- How to build a plugin that supports authenticated POST requests to the REST API from external servers?
- Hiding API routes list
- Get blog title with REST v2
- Is it possible to nest the JSON result of WordPress REST API?
- Match REST API post output from custom endpoint
- How to use the WP REST API for new user registration (sign up form)?
- REST API multiple media upload
- Filter post_content before loading in Gutenberg editor
- Attach featured image to custom endpoints
- Can’t send emails through REST API
- 401 Error when trying to make a REST API call to site
- WordPress: How to create custom REST API route?
- Create post using rest api with html content
- Does jQuery/Ajax send cookies when using the rest API or do I need to somehow add them?
- How to change user avatar using REST API?
- Android authentication