tags:

views:

20

answers:

1

I have got a .NET winform application that uses a Web Mapping Service that is password protected. Unfortunately I cannot attach a username and password to requests, ( the request are generated from a GIS mapcontrol)

I can think of two ways around it

  1. Intercept all web requests from my .NET app and add a username/password
  2. Set up an Apache webserver and use proxypass to pass along my request adding a username/password

Does anyone know how to do either of these?

A: 

Adding a password to a request (assuming they're using HTTP authentication instead of forms-and-cookie based authentication) is simply a matter of attaching a WWW-authenticate header to each request. You can find the details of how to encode the information here:

http://en.wikipedia.org/wiki/Basic_access_authentication

Since you're always using the same user/password for all requests, you'll be attaching the exact same string to every request, making it dramatically easier to implement. The mechanism you use is up to you, but any sort of proxy mechanism that allows you to add a header will do.

tylerl