views:

30

answers:

2

Hello,

I have big problem. Lets look on the code below:

protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
    if(Request.IsLocal)
         //DO WHAT I WANT
}

I have a client which connects with webservice and invokes some method. When the request is being made from my client to WS, the method Application_AuthenticateRequest is started.

On the local machine, where I have WS stared on, and I connect from local, this flag IsLocal has a value true.

The same webservice is hosted on some machine B. On machine B I have a windows service, which invokes some method of my WS.

In this case this flag has value False. I'm so confused...

Can anyone help me :-)?

Best regards,

A: 

What IP Address is your service using to call the WS? It should work as expected if you call it using 127.0.0.1, however if you are using the machines IP address you might have problems if the machine has multiple IPs configured.

Chris Taylor
A: 

I'm not sure. My service in Url uses the name of service. Such like https://www.something.eu/dkfposf

Is another way to determine in this method, that request is from the same machine?

Karol