Dave Burke : Freelance .NET Web Developer specializing in Online Communities

WebBrowser Control pre-authentication hack-of-a-hack

This is first blog post that is based on a post from my winforms project blog.  I'm dupin' here because it's a nutty issue with the WebBrowser control and NT Authentication in a Windows Forms application. Interesting, really, and something Winforms developers should factor in to their architecture. 

For purposes of this discussion, the application is a Windows Forms wrapper around business objects that have associated Sharepoint web resources. 

In this transitional .NET 2.0 Beta 2.0-to-RTM period I continue to use the WebBrowser winforms control for seemless access to those web resources.  I await a positive RTM control experience for lock-in.  In most situations the .NET WebBrowser control works beautifully.  The Project Workspace in the main body area shown here is an NT Authenticated Sharepoint web page which displays in an integrated webbrowser control.  Killer.


This works in its own sweet and seemless fashion when the user and the resource are both on the same domain, say, dbvt.com.  If the client winforms app is running on workstation69.dbvt.com and the Sharepoint server is SharePointServer.dbvt.com, and the web resource URL is http://SharePointServer/SomeWorkspace, then NT Authentication and the webbrowser control work in perfect harmony.  But if the winforms app is running on workstation69.dbvt.com but the Sharepoint server is on SharePointServer.acme.com, we have a problem.  IE takes it's ball and yells "wee-wee-wee" all the way home.  Action Canceled.  Forget any login display.


So what I did was add a pre-authentication login for those configurations when the client and host resources reside on different domains; or in crude terms, implemented a 10-minute hack-for-a-hack.  Joy returns and web resources appear in the WebBrowser control seemlessly once again because NT Authentication has been established. 

Agreed, 10-minute hacks are fine for products while still in beta, and the story isn't over.  A future post will tell the tale.  Consider this a short story about interesting Winforms and WebBrowser behavior that I wanted to share for Stardate 67254.

 

Comments (0) | Post RSS RSS comment feed

Posted on 11/7/2005 5:56:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke