Microsoft Eastern Strategic Architect Forum

Wednesday, March 24, 2004 9:23:55 PM (Central Standard Time, UTC-06:00)

Spent the last week in Orlando.  That's one of the reasons why the blog went dead for the week.  I spoke at the Microsoft Eastern Strategic Architect Forum about Web Services.  Then the family and I spent another 4 days doing the Disney theme parks.  Exausting to say the least.  Still had a great time. 

I also picked up some publications from the Patterns and Practices group that I had never seen before.  One was a pocket guide to Improving Web Application Security: Threats and Countermeasures called the “Pocket Guide to Improving Web Security”.  There was another book, that was based on the Enterprise Solution Patterns using Microsoft.NET, version 2.0 called “Software patterns: Organzing and Testing“.  I have looked around the net to see if there has been any others published, but didn't find anything.  These books are a condensed versions, and cover the main points of the books they derive from, I like the format.

Up and Coming Search Engines

Monday, March 15, 2004 9:56:51 AM (Central Standard Time, UTC-06:00)

I have been using Google for a while now.  I stumbled across the Vivisimo search engine the other day that uses clustering.  It is kind of nice how it groups items that are related so that you can drill down into the results in a more focused navigation style.

Smart Client Offline Application Block

Friday, March 12, 2004 10:39:13 AM (Central Standard Time, UTC-06:00)

The Offline Application Block, which is intended to serve as an architectural model for developers who want to add offline capabilities to their smart client applications. The block demonstrates how to:

  • Detect the presence or absence of network connectivity.
  • Cache the required data so that the application can continue to function even when the network connection is not available.
  • Synchronize the client application state and/or data with the server when the network connection becomes available.

You can find the block at:

http://msdn.microsoft.com/architecture/application/default.aspx?pull=/library/en-us/dnpag/html/offline.asp

Tracking Releases from Platform Architecture Group (PAG)

Friday, March 12, 2004 10:32:35 AM (Central Standard Time, UTC-06:00)

The PAG is the group that brings us information around best practices and creates what are known as application blocks. 

I bought applicationblocks.com a year ago with the intention to post release information in RSS around the blocks and the PAG activity.  I found that I would often hear about their releases weeks or even months after the fact. I wanted to provide to everyone a way to consume the information without having to visit the practices site on a daily basis.

I was later told that Microsoft would have an RSS feed up towards the end of last year, so I held off.  Well it is March now, and I still don't have an RSS feed, nor does Microsoft.  So what I have decided to do is use some Microsoft resources that I have and publish the notifications that I get around releases the PAG group in the Patterns & Practices feed.  I hope it is beneficial to everyone, and if you see something released and I don't have the feed current, shoot me an e-mail at shannon@conceptbench.com

SharePoint Resources

Wednesday, March 10, 2004 9:30:56 AM (Central Standard Time, UTC-06:00)

SharePointCustomization.com
Sample sites based on real world scenarios that fully expose great new functionality in FrontPage 2003 and Windows SharePoint Services.

http://www.sharepointcustomization.com/default.aspx

Impersonation on Different Threads in an ASP.Net Web application

Sunday, March 07, 2004 10:05:49 PM (Central Standard Time, UTC-06:00)
I had written some code to make some batch web service requests utilizing delegates.  One of the things we ran into was that any new threads created in the ASP.Net application we're being created under the ASPNet account rather then a service account we were using.  This caused some problems when we were accessing resources in our application.  The ASPNet account didn't have access to those areas.
 
I was surprised how easy it was to implement impersonation in the code.  The solution looked something like this.
 
In the Page_Load event:
 
//show who we are running as - should be customuser
System.Security.Principal.WindowsIdentity ident = System.Security.Principal.WindowsIdentity.GetCurrent();
Debug.WriteLine("Page_Load: " + ident.Name);
 
//retrieve the security token , and cache it in a static variable so it can be used by the other thread.
_intsecuritytoken = System.Security.Principal.WindowsIdentity.GetCurrent().Token;
 
//create the batch request object and submit a request
AsyncThreadRequest request = new AsyncThreadRequest();
request.Add(new SendReportRequestDelegate(this.FuncToRun));
request.SubmitRequest(true, 20);
 
The FuncToRun method looked like this:
 
privatevoid FuncToRun(string testval)
{
//show who we are running as (should be ASPNet)%
System.Security.Principal.WindowsIdentity ident =        System.Security.Principal.WindowsIdentity.GetCurrent();
Debug.WriteLine("FuncToRun() - Before Impersonation: " + ident.Name);
 
//create a new windows identity, with the cached security token from customuser
System.Security.Principal.WindowsIdentity windid = new System.Security.Principal.WindowsIdentity(_intsecuritytoken);
windid.Impersonate();
 
//show who we are running as - should be customuser
ident = System.Security.Principal.WindowsIdentity.GetCurrent();
Debug.WriteLine("FuncToRun() - Before Impersonation: " + ident.Name);
}
 
You can get the complete example here:
ImpersonateAsyncThread.csproj.zip (10.14 KB)