I have no idea what any of that code is, you don't need it for .Net 'Windows Authentication' anyway.
1) In your virtual directory, make sure that the application is set to the correct authentication type
http://msdn.microsoft.com/en-us/library/bb763173.aspx[
^]
2) In your web.config, set your authentication mode to 'Windows'
http://msdn.microsoft.com/en-us/library/ff647405.aspx[
^]
3) In your web.config, setup who you want to allow access...either by allowing groups of users or specific domain users
e.g.
<system.web>
<authorization>
<allow roles="Customer,Employee,Administrator,eBay Merchant"/>
<allow users="SomeDomain\d.morley"/>
<deny users="*"/>
</authorization>
</system.web>
Basically though, you should be able to get this up and running without a single line of code...it's all config settings