Daily Archives: February 6, 2006

Debugging tools in production: You’ve got your web service all protected with WSE, so why can just anyone browse to the asmx?

I had an email today from someone asking this question. They have a web service and a client app that use WSE2 to encrypt, sign and otherwise secure their data.

However, they were able to open up the asmx file, the operation and look at raw xml data in a web browser over the web. No authentication, no encryption, no signing. I could see it, too!

What a nightmare after all of the work to secure this data.

The reason for this problem was another case of debugging tools getting deployed to the production web server. Something I tend to rant about occasionally.

In order to browse from their development machine to the web service on a remote web server, they had added

<webServices>
 <protocols>
   <add name=”HttpGet” />
   <add name=”HttpPost” />
 </protocols>
</webServices>

and left them in the web.config when it was deployed to the server.

I was able to guess this pretty quickly since I once learned this the hard way, too. Sadly most of our best lessons are the ones that leave bruises. ðŸ™‚

For some more web.config tricks to hide your web service from public view as well as the wsdl, see this msdn doc on configuring web services for deployment.

Don’t Forget: www.acehaid.org

ClickOnce and Forms Authentication – you’ve got to be kidding me!

What do you think is going to be the most likely need for ClickOnce?

Deploying apps to anyone in the world? Not for me, I write custom apps for my client.

Deploying apps on the intranet? Sure, but we have had a very simple hack for that for a long time.

C’mon, think smart client….

Yep – deploying apps to users on the go over the web.

I need ClickOnce to work for mobile workers who need to be able to install and update their company’s custom software.

And what’s the best way to do this? You would think it was Forms Authentication. That’s what I want to use. Not all of these people have windows accounts or will be using VPN. But they do have logins to get to the company portal, fill out their timesheets online, etc. Additionally, we are already using web services as the back end to their smart-client applications so that they can do their work over HTTP.

But guess what – sure I have had two years to discover this, but I am just coming up for air on this one now – Forms Authentication is not supported for Click Once. See this msdn document.

Their suggestion? Just let anyone in the whole world download your client’s application and then use web service based authentication (which I just happen to already have built into this smart client app) to make sure they can’t use it.

No no no no no.  I do not think this would make my client very happy at all.

So I am struggling wtih hacking this together. The forms authentication works just great for accessing the installation page, but setup.exe and myapp.application are not protected by forms authentication. Anyone can browse right to them.

Next step is to feed them to ISAPI for this web app, which for some reason I can’t get to work yet.

I’m sure there have already been many discussions and rants about this problem but I have been focused on other things and am pretty late to the game.

Web deployment has become my a#1 pet peeve with .NET. I have been trying to use it since it was called zero touch deployment. ClickOnce is supposed to be my savior and I have ported their app to VS2005 just for ClickOnce. I won’t give up, but I might have to rant and rave every so often as I get this to work for me.

Don’t Forget: www.acehaid.org

Fun with .NET 1.1 and .NET 2.0 side by side on web server

I put .NET 2.0 on my client’s web server the other day. Both 2.0 and 1.1 asp.net apps continued to run just fine.

Last night I was mucking with some of the mappings in .NET 2.0 and they weren’t taking. So I did an iisreset. Here’s where that led me (to the best of my recollection)

  • 1.1 apps: Server Unavailable, 2.0 apps okay
  • run aspnet_regiis -i  for 1.1
  • 2.0 apps Server Unavailable, 1.1 apps okay
  • iis reset
  • 1.1 apps: Server unavailable, 2.0 apps okay
  • aspnet_regiis -i for 1.1
  • 1.1 apps okay, 2.0 apps okay
  • close the MMC for iis
  • 1.1 apps okay, 2.0 apps server unavailable
  • aaargh!! That shouldn’t have happened.
  • aspnet_regiiis -i for 2.0
  • 1.1 apps: Server Unavailable, 2.0 apps okay
  • aspnet_regiiis -i for 1.1
  • both okay
  • don’t touch a damned thing
  • slept with my fingers crossed
  • this morning – both still okay but I realize that clickonce deployment on the 2.0 site is broken.

Most of the above problems could have probably been avoided if I used some of the other available parameters for aspnet_regiis, such as -sn for fixing the mappings on just one application.

Update, though using the -sn was a good thing, the root of the problem (thanks to some reminders in the comments) was that I had neglected to create a separate Application Pool for the .net 2.0 websites. They were running in the same process as the asp.net 1.1 sites. So far, everyone has been behaving properly.

Don’t Forget: www.acehaid.org