0

I Have a ASP.net Core Web API and the end point goes something like this

https://{domainname}/v1/{ControllerName} and it is hosted on AWS Fargate Conatainer

and we scheduled the endpoint to be invoked at particular time of the day, but to our surprise we see that this is getting invoked from other sources and we decided to find the remoteip from where the API end point is getting invoked

tried adding with below snippet..

var ip = this.HttpContext.Features.Get()?.RemoteIpAddress?.ToString();

and when we invoked the API with Postman from my local machine the client id is not matching with my local machineIP, Any ideas here whether is my approach right or wrong?

clarifier
  • 119
  • 1
  • 13
  • 1
    Please show a dump of IP address. – Amir Mar 25 '21 at 04:19
  • it is IPV4 ip address with range starts from 10. and the client ip which i obtain from the code is not matching with any of the ip's when i look for ipconfig – clarifier Mar 25 '21 at 04:47
  • See ipconfig -a – Amir Mar 25 '21 at 05:29
  • @amir can u explain in detail please seems ipconfig-a is unrecognised command – clarifier Mar 25 '21 at 06:46
  • Dear clarifier, please let me know your error by a simple shot of your code otherwise I can't do anything :| – Amir Mar 25 '21 at 07:49
  • yea seems we are getting the AWS Application Load balancer ip as a remote ip when we use the below var ip = this.HttpContext.Features.Get()?.RemoteIpAddress?.ToString(); but can we get the remote user ip who is trying to invoke the API instead of load balancer is my query.. we dont have any specific error in this case. – clarifier Mar 25 '21 at 09:11

0 Answers0