• This plugin is generating the invalid token, as when sending this token for the API Request for authentication, the request does not work as intended.

    And when I use Basic Auth, it is working correctly. By the way I am testing this with wp/v2/media WordPress endpoint and it is giving me problems.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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 1 year, 8 months ago by projectmiso.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘It is not compatible with WordPress 6.1’ is closed to new replies.