1
I am searching a way to get the IP of the logged-in user
did the installation of:
Microsoft.AspNetCore.HttpOverrides 2.2.0
In Startup I added in Configure :
app.UseForwardedHeaders(new ForwardedHeadersOptions
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor |
ForwardedHeaders.XForwardedProto
});
In my controller I’m taking the IP this way:
var remoteIpAddress = Request.HttpContext.Connection.RemoteIpAddress;
I’m having an error informing that you have no support for the operation attempted