I'm not sure I completely understand, but maybe you could look into using the CSRF-token for this? This token is used to determine the request is coming from the app itself, and not from an external source.
API Authentication
Hi,
Using Laravel to create an API. The frontend makes requests to the API to obtain things such as product data, etc. and displays the data to the page (not an SPA but same principles). I'm looking to further develop the API to allow POST/PUT requests, but need to understand the best way to secure these routes.
I've looked at passport and installed it, but my application doesn't have users, therefore I cannot authenticate a user and use the CreateFreshApiToken middleware, obtaining the web token without Auth::login on every request.... which seems silly.
How can I protect these routes from Joe Bloggs, but allow the requests to only be made from the server?
Many thanks in advance,
Please or to participate in this conversation.