My app needs to communicate with MongoDb, and MongoDb requires the IP address of the requestor.
I've tried to this post but that didn't work.
I tried using the ClientIp that shows in the error log, but that didn't work.
When I use the "Allow access from anywhere" option in MongoDb, it adds 0.0.0.0/0 to the whitelist, and the app works.
How do I find the correct IP address of my enviornment to whitelist?
Second, will that IP address ever change?
OutSystems support provided me with a better solution to finding the server IP address.
In Service Center > Monitoring > Environment Health take the alphanumeric string in the "Front end Server" column, add .outsystemsenterprise.com to it, and perform an nslookup.
For example, abcde-123456.outsystemsenterprise.com
I was told this represents the environment's static public IP address.
Hello @Daniel Johnson
not sure about environment Ip, if you required environment front end server Ip,
that you will find it in the below path,
service center > monitoring > Environment health > front end server Ip address
for the enterprise application environment, you will find it here in the highlighted spot
I tried that one. Where my highlight is below.
When I add it to MongoDb it automatically appends port 32 to the end.
It's not working.
Hi Daniel,
are you using a cloud instance of OutSystems or do you run it on-premise. Same question for Mongodb :-) if you run OS on-premise and use a mongodb cloud instance then the IP adresses of your frontend servers cannot be used, but instead you need to allow the public IP adress of your Internet breakout.
Another question is how do you query Mongodb? Did you create a backend integration with Integration Builder or are you using a Forge component? Or do you fetch data client-side (In that case an Ip allow list wouldn't really help you as its then the browsers client ip address).
Stefan
Hey Stefan,
We're using a cloud instance of OutSystems. Same for MongoDb.
I installed the Integration Manager MongoDb plugin, and then just grabbed the extension library to use to get the data. I already had an integrations configurations module storing sensitive data server side, so nothing is hard-coded.
I did this because Integration Manager was improperly creating the structures based on the sample data. It was ordering all attributes alphabetically, and that was corrupting the data. I opened a case with OS Support, and they said it will be fixed in a future release, but it's low priority.
So, since I would have had to create the structures anyway if I chose the JSON format, I just published the plugin and used the library extension module it creates in my own service module.
I found this Forge component after a forum post I saw on the MongoDb forums, but Integration Studio won't let me publish it. I suspect because it creates an HTTP client directly in the code, which circumvents the need for API methods in Service Studio, thus not using any application objects. I don't know if OutSystems has officially said they're doing this, but that's my guess.
Anyway! I think I'll do the same but with ardoHTTP, since I need to publish this all the way up to the higher environments to check the IP addresses there, and likewise don't feel like it's fair to burn an AO to gather this information.
I used this component and its demo to get my IP address in DEV. Back in the Network Access list in MongoDb I took the first three octets and used 0 for the last, and then used the 24 CIDR block to target the full range. So far, it's working. For anyone else's edification, I learned that using 32 as the CIDR block means it's expecting traffic from that exact IP address. So, if you want to target a range you must use 24.
For example: 123.123.123.0/24