Getting the IP address of the client on an ASMX Web service

Ahsan

I am trying to Authenticate a web service by validating the IP address of the caller. The web service is meant to be internal to the network.

and in trying to do so the HttpContext.Current.Request.UserHostAddress has a weird value like "::1"

See debug point screenshot below.

enter image description here

Questions :

  1. Why does this not work and give the proper ip of the client?
  2. Is there a better way to authenticate the Web Service for an internal client?

Thanks in advance.

Lee Gary
  1. Why does this not work and give the proper ip of the client?

It is indeed working and you are seeing "::1" because it's a reserved loopback address for ipv6 AKA localhost or 127.0.0.1 in ipv4

IPv6

The loopback address, 0000:0000:0000:0000:0000:0000:0000:0001, may be abbreviated to ::1 by using both rules.

  1. Is there a better way to authenticate the Web Service for an internal client?

You have to know the difference between Authentication & Authorization, i suggest you create a new question with more details on the authentication methods that you are using in your web service

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Asp Net Web API 2.1 get client IP address

From Dev

Deserialization of ASMX web service failing partially

From Dev

How to get client IP address in a one-way ASMX Web Service

From Dev

Java - Getting a server's hostname and/or ip address from client

From Dev

Passing date to ASMX web service

From Dev

Getting client IP address and port?

From Dev

Getting requesting client's IP address on server

From Dev

Running a .asmx Web service as a Windows Service

From Dev

How to call methods on an ASMX service client

From Dev

Getting error for content mismtach while consuming client web service

From Dev

jQuery ajax request from asmx web service

From Dev

Getting IP address of host

From Dev

Getting client IP address in websocket library

From Dev

Getting client IP ADDRESS when using ServerEndpoint

From Dev

Call ASMX web service with parameter and get value from that web service?

From Dev

Java - Getting a server's hostname and/or ip address from client

From Dev

Invoking a web service - asmx - through a Microsoft Web API end point?

From Dev

Effects of adding new method to asmx web service

From Dev

Run asmx web service on STA

From Dev

Async call of ASMX web service

From Dev

Getting the IP address of the client on an ASMX Web service

From Dev

Testing WCF web service locally project after client was using this web service in remote address

From Dev

Getting requesting client's IP address on server

From Dev

How to call methods on an ASMX service client

From Dev

Getting client static IP address

From Dev

Consuming .asmx Web Service in java?

From Dev

“Could not find a part of the path” asmx web service

From Dev

Getting Client IP address in WCF with wsDualHttpBinding

From Dev

Deploy an asmx web service to a shared hosting server

Related Related

  1. 1

    Asp Net Web API 2.1 get client IP address

  2. 2

    Deserialization of ASMX web service failing partially

  3. 3

    How to get client IP address in a one-way ASMX Web Service

  4. 4

    Java - Getting a server's hostname and/or ip address from client

  5. 5

    Passing date to ASMX web service

  6. 6

    Getting client IP address and port?

  7. 7

    Getting requesting client's IP address on server

  8. 8

    Running a .asmx Web service as a Windows Service

  9. 9

    How to call methods on an ASMX service client

  10. 10

    Getting error for content mismtach while consuming client web service

  11. 11

    jQuery ajax request from asmx web service

  12. 12

    Getting IP address of host

  13. 13

    Getting client IP address in websocket library

  14. 14

    Getting client IP ADDRESS when using ServerEndpoint

  15. 15

    Call ASMX web service with parameter and get value from that web service?

  16. 16

    Java - Getting a server's hostname and/or ip address from client

  17. 17

    Invoking a web service - asmx - through a Microsoft Web API end point?

  18. 18

    Effects of adding new method to asmx web service

  19. 19

    Run asmx web service on STA

  20. 20

    Async call of ASMX web service

  21. 21

    Getting the IP address of the client on an ASMX Web service

  22. 22

    Testing WCF web service locally project after client was using this web service in remote address

  23. 23

    Getting requesting client's IP address on server

  24. 24

    How to call methods on an ASMX service client

  25. 25

    Getting client static IP address

  26. 26

    Consuming .asmx Web Service in java?

  27. 27

    “Could not find a part of the path” asmx web service

  28. 28

    Getting Client IP address in WCF with wsDualHttpBinding

  29. 29

    Deploy an asmx web service to a shared hosting server

HotTag

Archive