.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

IIS 6 Windows Authentication + ASP.NET Impersonation when application resides on a UNC share

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
When the application resides on a local folder, the current user ((System.Threading.Thread.CurrentPrincipal.Identity.Name) is the windows authenticated user. OK. But..when the application resides on a UNC share, the current user is the windows user configured in IIS virtual directory to access the UNC share. This is not the desired behavior in my case, what I want is to have the same behavior as in the case where the application is in a local folder (current user matches the windows authenticated user)This is configurable in some way in IIS 6 or IIS 7?   thanks in advance,Alexander Wolff  

View Complete Post

More Related Resource Links

Possibility of Windows authentication in Windows application

Hi, I have developed Windows form application( C#). I need to authenticate user using Windows Authentication mode. i.e When a user tries to access the developed Windows form application , the windows authentication log on screen should pop up asking for the user credentials ( user name , user password, domain). Our requirement is to use the default windows logon screen which generally pops up to get the user credential instead of the custom developed logon screen.This is similar to Windows authentication in ASP.Net but for Windows form application , Is it possible to authenticate user using Windows authentication mode? If so how?

Using Windows Authentication for connecting sql server from web application using froms authenticati

Hi Experts, I have one web application which is configured to be use froms authentication. But, I don't want to use SQL Authentication to connect to SQL server, I want to use windows authentication. Can somebody plase give me detailed setps for how to implement this? Thanks for your help in advance. -Chintak. 

Customize windows authentication for Web Application

Hi All, I am using Windows Integrated Authentication with impersonation for all my web applications (on IIS 7 and 7.5), and everything is perfect. Now I would like to enhance the authentication procedures bypassing the login prompt from IIS, and supplying a custom page to collect the Username + Password inputs from Users, but still mantaining the Windows Authentication support (I rely on the WindowsPrincipal in my application for many core activities). I just would like to replace the IIS popup with my custom authentication page. First of all I have tried to mix the WIA with Forms Authentication, but - even if I succeed in authenticating users against the Active Directory - the result is not what I was looking for, because I want to mantain Windows Authentication and not migrating the mechanism to Forms Authentication (even if implemented with the AD provider). The first step I am trying is to use the "LogonUser" function to create the correct WindowsPrincipal and then the "Impersonate" method, but after this step I have no idea about how to persist the authentication data and\or to pass the User information to the Windows Authentication. As a result, when I execute the first redirection to another page the information about the user manually logged are lost.   Any idea? Thank You very much in advance. Alberto

how to change the web application Database connection form Windows authentication to SQL Server acco

Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.

Enabling Windows Authentication to SQL Server using Application Pool Credentials

I have created a WCF Service (VS2008), an application pool account which has the access to the SQL Server(in remote machine). Configured the App Pool account to the Virtual Directory in IIS (Version 6.0). Once I browse through the SVC file, I can see the WSDL file. I have the "Windows Authentication" and the 'Anonymous authentication" Checked in the Properties for the Virtual Directory. But when I access service through Client, I get "The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.". Binding that is being used is HTTPBinding. I have set the Identity Impersonate to True as well. Bottom line is - I need to use the App Pool account to connect to the SQL Server. Could some one please help me in this?  

ASP.NET application and authentication on Windows XP IIS


I have an application which requires no username using forms and it automatically gets the current workstation authenticated username and tries to check if user is in Active Directory or not and then autheticate internally. It works fine inside Visual Studi but when I put it on windows XP IIS site it fails. please have a look at my code behind.

Imports System
Imports System.Data

Partial Class BSMChecklist
Inherits System.Web.UI.Page
Dim LoginName As String = ""
Dim UserID As Integer = 0
Dim UserName As String = ""
Dim BranchID As Integer = 0
Dim BranchName As String = ""
Dim Group As String = ""
Dim GroupID As Integer = 0
Dim BackupGroups As String = ""
Dim BackupGroupIDs As String = ""

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'TabContainer1.Tabs(2).Enabled = False
If User.Identity.Name.IndexOf("Corp\") <> 0 Then
LoginName = Server.HtmlEncode(User.Identity.Name).Replace("Corp\", "")

UserName = GetUserName(LoginName)
If UserName <> "" Then

Tomcat Windows Integrated Authentication fails with More than 1 Web Application


Hi all,

I’m using Tomcat 5.5.23 on a Windows server 2003 (64 bit).

Tomcat runs as a window service, using an Active Directory account.

DB is configured to Windows Authentication mode alone.


Tomcat contains 2 web applications.

The DLL’s (sqljdbc_auth.dll) location is the value of Tomcat’s –Djava.library.path parameter.



The container loads, the first web application loads and successfully establishes a connection to the DB,

But the second web application fails to connect to DB, prompting:

 com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.



When loading tomcat with only a single web application (either one), the web application successfully connect to the DB.

This is why I don’t think the reason is at web.xml.


Any idea?


Thanks, Itamar

Tomcat Windows Integrated Authentication fails with More than 1 Web Application


please check related topic in SqlDataAccess forum.


Thanks, Itamar

Application Architecture in Windows Forms 2.0

Applications have special support in Windows Forms. For starters, you can manage and tailor your application's lifetime, and, when the work flow is disrupted by an unhandled exception, you can choose from several methods of response. Then, there are several application models that you can employ, including Single Document Interface (SDI) and Multiple Document Interface (MDI) applications, each of which can support either multiple-instance or single-instance mode, the former the VS05 default and the latter requiring special consideration. All applications, however, can discover and use a wide variety of information about the system and environment they execute in.

Application Architecture in Windows Forms 2.0-Single-MDI Applications

Consider an MDI application like Microsoft Excel; files opened from the file system (by double-clicking) are all opened as separate child windows within the parent Excel window.7 For the first instance of an MDI application to open a new child window to display the file that was passed to the second instance of the application, the second instance must be able to communicate with the initial instance.

all basic windows controls,wpf controls,silverlight application

here you will find all the information from basic.

Web Matrix + Windows Authentication


I'm curious if its possible to get windows auth working with asp.net webpages/webmatrix.

I've got it published to IIS with windows auth turned on and anonymous/forms/basic turned off.

I'm guessing the WebSecurity Helper probably won't work here but can you access User.Identity.Name etc?

Sorry for the newbie questions, I've only just started working with asp.net ^^,

SqlServer - Windows Account to install Application from Gallery


Referring to this tutorial: http://www.asp.net/webmatrix/tutorials/download-and-install-an-asp-net-application

I selected umbraco cms and got this wizard:

I already have Standard Sql Server 2005 on my machine which I wanted to us for above DB and not SqlExpress.

I did not remember "sa" account pwd nor I use explicitly any account to connect to my Sqlserver. I use Windows Authentication account i.e implicit authentication. So I created new account and gave all rights and used it in the above wizard and was able to install the database after some struggle.

My question is: What if I want to use my Windows Account to install the database above? Why the wizard don't have any option to use Windows Integrated Authentication?

Note: I can create the DB with external user I created, just looking specifics for using Windows Authentication for above installation.

Windows Authentication for IIS in Windows 7 Home Premium Edition - for ASP Websites.


How to create a virtual directory and get benefit of the IIS. Is there a workaround to accomplish this without the Windows Authentication for Windows 7 Home Premium Edition?

Thanks in advance, 

Using windows authentication to access SQL when using ASP.NET 4.0 via COM+


I am using SQL Server 2008 under windows authentication, front end is ASP.NET which uses COM+ to access database.

COM+ components are configured to run as domain user.

When looking through the logs (SQL Profiler), I can see the login name as the configured identity instead of windows indentity.

I have got Website running under "Intergrated Windows Authentication" and database is running locally on webserver.

Web configure contains entry for <identity impersonate="true"/>.

My connection string is

connectionString="data source=db01\test01;initial catalog=test; integrated security=SSPI;persist security info=False; Trusted_Connection=Yes"

Any ideas?




Cloud Storage: Fueling Your Application's Engine with Windows Azure Storage


Yes, you can run background processes in the cloud. Kevin Hoffman and Nate Dudek use a shopping cart example to demonstrate how to build an application engine as well as implement asynchronous messaging and processing using Azure Storage.

Kevin Hoffman, Nathan Dudek

MSDN Magazine January 2010

Windows Forms: Give Your .NET-based Application a Fast and Responsive UI with Multiple Threads


If your application performs any non-UI processing on the thread that controls the user interface, it may make the app seem slow and sluggish, frustrating users. But writing multithreaded apps for Windows has long been restricted to C++ developers. Now with the .NET Framework, you can take advantage of multiple threads in C# to control the flow of instructions in your programs and isolate the UI thread for a fast and snappy user interface. This article shows you how. Also, it discusses the pitfalls of multiple threads and presents a framework for safe concurrent thread execution.

Ian Griffiths

MSDN Magazine February 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend