I think this is a fair approach. Using a token has the same dangers right? You can just copy the token from the javascript on the page and use that on another website.
authenticate api call from specific domain
Similar to the MaxMind JavaScript Client API, I would like to create a client for my own API service.
What I like about the MaxMind JavaScript Client is the fact that it has a simple domain authentication. I create a MaxMind account and register the domain which is allowed to access the API. In a second step I simply install the JavaScript client on my website and voilà, it works. No API token necessary. Their API service simply checks if a request comes from a registered domain.
While I believe this is simple to implement in Laravel (simply check the domain of a request and cache the IP), I'm not sure if this is 100% save. What are your thoughts?
Please or to participate in this conversation.