Hello,
I woul like to ask if OutSystems provides any IP whitelisting capability to restrict access to exposed REST APIs for specific IP addresses. We are using an on‑premises environment, and our requirement is to apply this restriction only to certain REST APIs that we have published.
Alternatively, would this need to be implemented at the code level, by adding Site Properties and using the OnAuthentication event with Custom Authentication, then checking whether the retrieved client IP matches our allowed static IPs (stored as a secret Site Property)?
Any guidance or recommended best practices would be greatly appreciated.
Thank you.
Yes, you can do IP whitelisting for exposed REST APIs, but OutSystems doesn’t provide a built‑in “per-API IP allowlist” feature out of the box. You have two main options:
Since you’re on‑premises, the most robust approach is usually to enforce IP restrictions at the network / API gateway / reverse proxy / firewall level, and only allow the desired IP ranges to reach your OutSystems front-end servers or specific paths.
Pros:
Cons:
If you already have a WAF or API gateway, you can typically:
/MyModule/rest/MySensitiveAPI/*
Your alternative design (custom authentication + IP allowlist) is aligned with OutSystems recommendations for custom logic on exposed REST APIs. You can implement this per-API, and keep the IP list in a Site Property or entity.
The approach is:
Create an IP allowlist configuration
10.2.3.4
203.0.113.0/24
Use the REST API’s OnAuthentication event
Obtain the client IP
HTTPRequestHandler.GetIP()
X-Forwarded-For
GetIP()
HTTPRequestHandler
Match the IP against your allowlist
Per-API granularity
Combine with proper authentication
Maintainability
Dynamic IPs
Testing
If you describe your expected caller patterns (static corporate IPs vs dynamic), I can suggest a more concrete schema for the allowlist (e.g. entity model and matching logic).