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 Dev

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

From Dev

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

From Dev

Getting client IP address and port?

From Dev

Getting client static IP address

From Dev

Getting client IP address in websocket library

From Dev

Getting client IP ADDRESS when using ServerEndpoint

From Dev

Getting requesting client's IP address on server

From Dev

Getting requesting client's IP address on server

From Dev

Getting Client IP address in WCF with wsDualHttpBinding

From Dev

Passing date to ASMX web service

From Dev

Run asmx web service on STA

From Dev

Async call of ASMX web service

From Dev

Consuming .asmx Web Service in java?

From Dev

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

From Dev

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

From Dev

Running a .asmx Web service as a Windows Service

From Dev

How to call methods on an ASMX service client

From Dev

How to call methods on an ASMX service client

From Java

Asp Net Web API 2.1 get client IP address

From Dev

jQuery ajax request from asmx web service

From Dev

Deserialization of ASMX web service failing partially

From Dev

Effects of adding new method to asmx web service

From Dev

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

From Dev

Deploy an asmx web service to a shared hosting server

From Dev

Getting IP address of host

From Dev

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

From Dev

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

From Dev

Getting error for content mismtach while consuming client web service

From Dev

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

Related Related

  1. 1

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

  2. 2

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

  3. 3

    Getting client IP address and port?

  4. 4

    Getting client static IP address

  5. 5

    Getting client IP address in websocket library

  6. 6

    Getting client IP ADDRESS when using ServerEndpoint

  7. 7

    Getting requesting client's IP address on server

  8. 8

    Getting requesting client's IP address on server

  9. 9

    Getting Client IP address in WCF with wsDualHttpBinding

  10. 10

    Passing date to ASMX web service

  11. 11

    Run asmx web service on STA

  12. 12

    Async call of ASMX web service

  13. 13

    Consuming .asmx Web Service in java?

  14. 14

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

  15. 15

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

  16. 16

    Running a .asmx Web service as a Windows Service

  17. 17

    How to call methods on an ASMX service client

  18. 18

    How to call methods on an ASMX service client

  19. 19

    Asp Net Web API 2.1 get client IP address

  20. 20

    jQuery ajax request from asmx web service

  21. 21

    Deserialization of ASMX web service failing partially

  22. 22

    Effects of adding new method to asmx web service

  23. 23

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

  24. 24

    Deploy an asmx web service to a shared hosting server

  25. 25

    Getting IP address of host

  26. 26

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

  27. 27

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

  28. 28

    Getting error for content mismtach while consuming client web service

  29. 29

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

HotTag

Archive