How to force JWT auth for default GET endpoints of WordPress rest api?

Question

The default GET endpoints (for e.g. http://scintec.net/wp-json/wp/v2/posts/) of the WordPress Rest api are public and can be accessed by anyone.

I am currently interacting with a WordPress Rest api where I am using JWT authentication for POST requests.

I don’t want my GET endpoints to be public and they should also require the JWT token in order to pass the request. How can this be done? I went through the documentation on this page https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/ but didn’t find anything in this regard.

Also I am using the JWT Authentication for WP REST API plugin for JWT auth.

0
, , , Navjot Singh 3 years 2020-06-09T03:10:27-05:00 0 Answers 97 views 0

Leave an answer

Browse
Browse