CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Steve Hebert's Development Blog

Steve's Blog - From .Net to dotMath and everything in between.

Securing WSDL - first run

I've been pretty happy so far with an implementation to secure my webservices using an IHttpModule to capture the SoapHeader early in the pipeline and authenticate before getting to the webservice call itself.  This eliminates the need to deal with authentication in each WebMethod call.

Another area I'm looking at is securing the WSDL - since the WSDL request is not made using a SoapRequest, the mechanism has to be different.

Right now, I'm considering hooking the ASMX request and looking for the ?WSDL parameter (https://myService/myService.asmx?WSDL).  I could then intercept the call and hand back a bogus/empty WSDL if authentication parameters are not specified.  If they add parameters for authentication, then I could hand back the real WSDL (https://myService/myService.asmx?WSDL&User=YaddaYadda&Pwd=BlahBlah).

What's interesting is that I could use my permissioning bits to hand back a custom WSDL, but I'd rather not force someone to reacquire the WSDL if they purchase new capabilities. My feeling now is that leaving any messages about permissioning are best left up to the individual functions.

I'll blog more as I move forward on the implementation.


Comments

Nick Parker said:

Have you considered using WSE and embedding either a UsernameToken or KerberosToken to the SOAP header?
# March 31, 2006 11:38 AM

Erik Lane said:

Hey Steve.  Would it be possible, in your scenario, to just turn off the Documentation Protocol for Webservices and just distribute a static WSDL for people who will be provided access?  I did something similar last year.

http://blog.eriklane.com/archive/2005/11/16/2349.aspx

Erik
# April 3, 2006 2:37 PM

shebert said:

Thanks for the comments, I've been looking at the WSE bits and the UsernameToken.  My initial implementation really did the same thing that WSE does, just a manual intercept on the pipeline.

I hadn't considered shutting off the WSDL - it's a nice idea.  I'm not sure how this will float with support.

Thanks again,
-Steve
# April 6, 2006 5:58 PM
Check out Devlicio.us!

Our Sponsors