@imani3011 Have you got any solution for this?
for a quick solution – you can add “token/validate” to your request path or in a query string argument, and that will cause jwt bypass the token verification. For eg: https://example.com/wp-json/v1/callback?path=token/validate
The above solution will work, but I dont know this is a proper way or not? I dont see any filters to do this in the codebase too.
In the Plugin Changelog – Version 1.3.0 they are talking about this: Allow for Basic Auth, by not attempting to validate Authentication Headers if a valid user has already been determined (see: https://github.com/Tmeister/wp-api-jwt-auth/issues/241)
I dont know if they are referring to the same issue, if it is, that is not working. I can see there is no reply for almost all support questions here, so not expecting much.
Thank you so much @salih24by7! Your comment helped me out on how to dismiss errors when accessing public endpoints when you have the JWT Authentication for WP REST API plugin active. Thanks! 😄
Error:
Warning: Undefined array key “HTTP_AUTHORIZATION” in \app\public\wp-content\plugins\jwt-authentication-for-wp-rest-api\public\class-jwt-auth-public.php on line 222
Warning: Undefined array key “REDIRECT_HTTP_AUTHORIZATION” in \app\public\wp-content\plugins\jwt-authentication-for-wp-rest-api\public\class-jwt-auth-public.php on line 225
@artneo Glad to here that 🙂
Trying to disable the JWT plugin for some endpoints as well. Surprised there isn’t a filter for this. Thanks for the workaround @salih24by7 !