Country and VPN restrictions
Decide which connections your app accepts
Suppose MyApp is licensed for customers in selected countries. A country policy lets the developer reject sign-ins from other countries. A VPN/proxy policy can separately reject connections classified by the configured reputation service.
Country is approximate
The country comes from the observed IP address. It is not GPS and it cannot establish a person’s physical location. Corporate networks, mobile carriers and VPN exit nodes can change the country an address maps to.
Open the app’s Access Policies to choose blocked countries and connection rules. Test an allowed country and a blocked country with known addresses. Testing only localhost does not prove that country restrictions work.
VPN exceptions are not a general whitelist
A VPN exception should allow the selected address through the VPN check without turning every other address into a denied connection. A restrictive IP whitelist has a different purpose: it limits access to the listed addresses. Country rules still apply according to the policy; a VPN exception is not a universal bypass.
Configure the proxy correctly
In production the API may receive traffic through Cloudflare or another reverse proxy. Only trust forwarding information from the proxies you explicitly configure. A caller must not be able to choose their country by supplying an arbitrary address header.
If VPN detection is enabled and the reputation service cannot make a decision, the current API rejects the check rather than silently accepting an unverified result. Plan how your app explains that temporary failure. Do not describe an unavailable lookup as proof the customer uses a VPN.
These checks are additional access rules. They do not replace license validation, session checks or protection of valuable operations on your own server.

