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 use WP-REST API to login user and get user data for Android app?
- WP REST API returns blank response if post is too long
- How to feed a HTML5’s EventSource with a REST API custom endpoint?
- Retrieve CSS and JS From the REST API
- WordPress 4.7 REST API endpoints
- REST API multiple media upload
- Can’t send emails through REST API
- 401 Error when trying to make a REST API call to site
- Does jQuery/Ajax send cookies when using the rest API or do I need to somehow add them?
- Android authentication
- Upload image to wordpress using REST API
- Can I define multiple callback methods depending on the call method?
- Filter post content in REST API
- WP Rest API convert permalink to post ID for fetch
- How add meta fields to a user with the wp-api?
- WordPress Rest API response
- Check Password Strength using WordPress API
- Why does AWStats show /wp-json* as Viewed URLs
- How send get request to external api with username and password
- permission_callback has no effect
- Updating link on page via REST api
- How to order WordPress Rest API data
- WP Rest API – How to convert embedded to json object in Java [closed]
- WP REST API plugin 500 errors?
- wp-cli command throws error : “SSL routines:tls_process_server_certificate:certificate verify failed” while querying https website
- Setting maintenance mode via REST API
- How to receive data by http POST request
- rendering view in backbone
- WP API querying a custom post type and a custom field
- Custom endpoint to get all custom taxonomy terms
- Notify Jenkins of new post on WordPress
- Curl requests sent two times
- Check authentication credentials using WP REST API
- How to get author meta into post endpoint in api v2
- WordPress REST API V2: how to get list of all posts?
- Sidebar endpoint using WordPress API
- How to get data from /wp-json/wp/v2/users/me
- Get custom posts in gutenberg block
- WordPress REST API parameters are not affecting a response
- Update meta_value in wp_postmeta using API
- WordPress plugin with CORS
- WordPress REST API not working on localhost
- REST API – Allow /users endpoint depending on a custom capability
- “Error: cURL error 60: SSL certificate problem: certificate has expired” when create product in WooCommerce via REST API
- How to use WordPress REST api to login a user?
- Create User with Profile and Cover Images using REST API
- Wrong encoding of dynamic block properties problem when loggen in as editor
- Remove unwanted fields from WP API response
- Need wp rest api for featured video post
- REST api header link href
- Error rest_post_invalid_page_number trying to call Rest API
- WordPress & React Native
- update meta data (like view counter) by rest-api
- Rest API hook ‘rest_insert_post’ not returning request object
- How Can I keep password protected posts in the json requests but not on frontend queries?
- WP_REST_Request::get_json_params() Parsing null as Zero
- Script tag in string in wordpress rest api body to create post
- Customizer Changeset, Sidebar and Rest API Custom Endpoints
- WordPress REST API won’t allow me to filter by author ID when called internally, works externally in Postman