This project has moved and is read-only. For the latest updates, please go here.

WMS Client and authentication

Feb 8, 2007 at 5:37 AM
Hi. I just began looking at SharpMap, which is very impressive.

Just for fun, I thought I'd try using the WMS Client demo with another server, but that server requires authentication, and I see no way to supply credentials to the WmsLayer c'tor.

Just wondering how that's handled (e.g., CredentialCache.DefaultNetworkCredentials) ?
Feb 8, 2007 at 6:43 PM

Credentials can't set in the c'tor, but they are available via the property Credentials.

Feb 8, 2007 at 7:11 PM
Hi and thanks for the reply.

Unfortunately, the c'tor takes a URL and tries to connect to the server, which requires the credentials. Just to get it working, I overloaded the WmsLayer c'tor to take the credentials, and that worked as expected. I was only interested in seeing if I could get the sample app to connect to my server and obtain a list of layers, which it did flawlessly. I also added a treeview to the sample app, to show a hierarchial view of the layers. If anyone is interested in that I'll be happy to post it.
Feb 8, 2007 at 8:00 PM
This discussion has been copied to Work Item 8096. You may wish to continue further discussion there.
Feb 8, 2007 at 8:05 PM
Edited Feb 8, 2007 at 8:12 PM

Just send your samples to my mail address( ) and I will include it in the official samples. Also send me your changes to the WmsClient to support credentials correctly.