Did anyone find a resolution to this? We looked into changing our code to see if we can send requests differently but still getting the error “invalid token sent”
args=”{\”body\”:{\”token\”:\”***\”},\”sslverify\”:false}” response=”{\”headers\”:{},\”body\”:\”Invalid token sent\”,\”response\”:{\”code\”:400,\”message\”:\”Bad Request\”},\”cookies\”:[],\”filename\”:null,\”http_response\”:{\”data\”:null,\”headers\”:null,\”status\”:null}}” response_code=400
The error is caused by the plugin’s Jwt_Auth_Public->validate_token() function not receiving any data from the “WP_REST_Request $request’ param. There is a disconnect between WordPress 6.1 and the plugin.
In our custom code integrating this plugin we created a temporary work-around where we are recreating the request object and filling it with header and request data before sending it to the Jwt_Auth_Public->validate_token() method.
Sample code for out pre-populated request object looks like this. Use with caution and adapt for your needs.
$request = new WP_REST_Request( '<your request method', '<your request path>');
$request->set_headers( getallheaders() );
$request->set_query_params($_REQUEST);
$jwt = new Jwt_Auth_Public();
$result = $jwt->validate_token($request);
Plugin creator: please let us know if/when you can issue a permanent fix for this.
-
This reply was modified 3 years, 2 months ago by
projectmiso.