Closed jobberma closed 3 months ago
Have you sent a JWT with this request? If you're sending one, it still has to be valid. I'm also curious as to how you're getting an HTML error message in response to a POST request...
Have you sent a JWT with this request? If you're sending one, it still has to be valid. I'm also curious as to how you're getting an HTML error message in response to a POST request...
Thanks for your reply, I do not send a JWT token in this endpoint because it's public and it must work without token. I am testing in postman and it returns that as a HTML response.
Have you tried this with all other plugins disabled? I don't know how this plugin could return an HTML response at all.
Have you tried this with all other plugins disabled? I don't know how this plugin could return an HTML response at all.
Okay I will check that because it's a staging env. How about whitelisting the endpoint ? Is it done by default or I have to add other confs ?
There is no whitelisting any more, the plugin no longer prevents any access to any endpoints, it simply authenticates a token if one is provided, access to any routes is controlled by the permissions callback of the routes themselves, not sure why __return_true
wouldn't be working for here, so it'd be worth doing some debugging here as well to check that this callback is being called as you'd expect.
For UPDATE :
The html output was generated from the staging server because server authentication was needed outside of API auth. I removed "jwt_auth_whitelist" filter and everything is working as expected because callbacks were handled before in REST API endpoints. Thanks anyway for your help.
Hello,
I just updated to v3 and I have some whitelisted endpoints. I removed filter "jwt_auth_whitelist" in code but still getting 401 error as below :
Example of API endpoint declaration :
Is there something else I have to edit/add ?
Thanks