Reputation: 798
i am searching for best solution to restrict user access to my API . i want restrict users to get access to my API .
Upvotes: 1
Views: 1758
Reputation: 378
There are 2 things, which you can do is.
Write your own code, block the user based on certain factors for the country. Example - Use IP location,location,timezone,navigator.language,Accept-Language etc. From all this factors one can filter out the request coming from the country. It might not be efficient in some cases.
Use cdn providers like cloudflare, in which you can block the access from several countries and everything handled by them.
Upvotes: 2