I have a Plugin similiar to woocommerce which is providing me an REST API Endpoint for getting some user specific data.
When I try to access the API via Postman, i get an 401 - Not Authorized Error.
Of course, i have to authenticate my user to the api but how?
I found this (and many similar) posts to this topic: How to: Make JWT-authenticated requests to the Wordpress API
But all these examples seems to be for remote applications.
In my case, i want to use the api from my backend code.
And the page where i want to display the information (gathered from api) is only accessable for logged in users.
So i want to make an api call, for the current logged in user. This should happen automatically. Cant manually create keys for each user who wants to use the api, all users should have access.
Can i use the approach in the link or is there an better way to do this?