473,729 Members | 2,149 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Server delegation

This is a classic double hop delegation issue, however its the first time we
are setting this up so we are doing something incorrectly. If we run
through the IDE or using a localhost path on the web server the command
succeeds. However, if we use the servername or ip through IIS it fails.
For this reason we know we have permissions setup correctly on the file
server.

Can anyone identify what we could possibly be doing wrong here:

File Server: Windows Server 2003
Web Server: Windows Server 2003, IIS 6.0
Active Directory: Full Windows 2003
Web.config: Auth mode "Windows", Impersonate="tr ue"
In AD, my Web Server has Delegation Trusted to the File Server (Kerberos
only) with cifs, and HOST services.

Simple test is:
System.IO.Copy( "C:\test.do c", "\\FILESERVER\T emplate\test.do c")

TIA, any help would be greatly appreciated,

- Marc Castrechini
Oct 31 '06 #1
6 2836
Hello Marc,

From your description, you're going to use kerberos delegation to make the
client authenticated user identity double hop to downstream services,
however, you found that it didn't work in some conditions in the test
environment, correct?

As for the kerberos delegation you current use, I think it should be
unconstrained delegation, yes? There're some techical reference describing
how to configure and troubleshooting kerberos delegation related scenarios,
and I will conclude them to the following key points which is most
important for kerberos delegation scenarios:

** Make sure that the client account(general ly the domain account) is
configured for delegation in AD

** Make sure that the server service's account is configured as trusted for
delegation (for target service) in AD

** If your application runs under a custom domain account, you need to
configure your domain account in Active Directory to be trusted for
delegation. You must also register a service principal name in Active
Directory to associate the domain account with the HTTP service on your Web
server. If you use domain accounts to run your Web application or the
downstream service that you are accessing, you must also ensure that
appropriate service principal names (SPNs) are created in Active Directory
for those accounts

** Make sure the authentication' s client and server will be able to use
kerberos as the authentication schema when establish connection

For your scenario, I think you should have made the first two items ready.
And since you said that the problem occurs when you try access the server
through servername(full dns name) or ip address, ti failes, I think it is
likely that you need to check the 3rd item above, have you registered the
servcie priincipal name in AD to associate them with your downstream
service(ASP.NET applications' process account)?

For general troubleshooting , I suggest you test the following things:

1. Always test from remote client machine rather than on local webserver
because the local logon session is different than the one generated through
remote authentication. You can visit your ASP.NET web application from a
remote client (XP or 2003) when test kerberos behavior.

2. In your ASP.NET application's code(after being impersonated), use the
following class to check whether the current impersonated windows identity
is the correct one and whether its AuthenticationT ype is kerberos(Neogia te)
and whether its ImpersonationLe vel is Delegation:

System.Security .Principal.Wind owsIdentity.Get Current().XXXXX (properties)

If those property value is not conform to kerberos delegation token, it
seems the problem occurs at client browser and web server's authentication.
3. One the second downstream service (where you put IO.Copy code), you can
programmtically create a file on the machine (set everyone write permision)
and check the creation owner to see what's the account that has been
forwared to the scenod service).

Here are some related reference article in MSDN which may be helpful.

http://msdn.microsoft.com/library/de...us/dnnetsec/ht
ml/SecNetHT05.asp

http://msdn.microsoft.com/library/de...us/dnpag2/html
/paght000023.asp

http://msdn.microsoft.com/library/de...us/dnnetsec/ht
ml/SecNetch13.asp

Please feel free to let me know your test result or if you have any new
findings.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 1 '06 #2
Thanks for the detailed answer. A few questions from it:

Is running the application (and by that I presume the Application Pool
Identity) using a custom domain account required for Delegation? We were
trying to use strictly the Network Service account so we could eliminate the
possiblity of SPN issues. We thought setting up Delegation on the Web
Server to talk to the CIFS service on the File Server would work around
that. Is that not correct?

Another thing we tried is the Identity recomendation you mentioned. We
found that our ImperosonationL evel is "Impersonat ion" not "Delegation ". Our
user is the current domain user in DOMAIN\USERNAME format as expected. Does
that add any insight to what we are doing incorrectly?

TIA,
- Marc Castrechini

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:Ag******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello Marc,

From your description, you're going to use kerberos delegation to make the
client authenticated user identity double hop to downstream services,
however, you found that it didn't work in some conditions in the test
environment, correct?

As for the kerberos delegation you current use, I think it should be
unconstrained delegation, yes? There're some techical reference describing
how to configure and troubleshooting kerberos delegation related
scenarios,
and I will conclude them to the following key points which is most
important for kerberos delegation scenarios:

** Make sure that the client account(general ly the domain account) is
configured for delegation in AD

** Make sure that the server service's account is configured as trusted
for
delegation (for target service) in AD

** If your application runs under a custom domain account, you need to
configure your domain account in Active Directory to be trusted for
delegation. You must also register a service principal name in Active
Directory to associate the domain account with the HTTP service on your
Web
server. If you use domain accounts to run your Web application or the
downstream service that you are accessing, you must also ensure that
appropriate service principal names (SPNs) are created in Active Directory
for those accounts

** Make sure the authentication' s client and server will be able to use
kerberos as the authentication schema when establish connection

For your scenario, I think you should have made the first two items ready.
And since you said that the problem occurs when you try access the server
through servername(full dns name) or ip address, ti failes, I think it is
likely that you need to check the 3rd item above, have you registered the
servcie priincipal name in AD to associate them with your downstream
service(ASP.NET applications' process account)?

For general troubleshooting , I suggest you test the following things:

1. Always test from remote client machine rather than on local webserver
because the local logon session is different than the one generated
through
remote authentication. You can visit your ASP.NET web application from a
remote client (XP or 2003) when test kerberos behavior.

2. In your ASP.NET application's code(after being impersonated), use the
following class to check whether the current impersonated windows identity
is the correct one and whether its AuthenticationT ype is
kerberos(Neogia te)
and whether its ImpersonationLe vel is Delegation:

System.Security .Principal.Wind owsIdentity.Get Current().XXXXX (properties)

If those property value is not conform to kerberos delegation token, it
seems the problem occurs at client browser and web server's
authentication.
3. One the second downstream service (where you put IO.Copy code), you can
programmtically create a file on the machine (set everyone write
permision)
and check the creation owner to see what's the account that has been
forwared to the scenod service).

Here are some related reference article in MSDN which may be helpful.

http://msdn.microsoft.com/library/de...us/dnnetsec/ht
ml/SecNetHT05.asp

http://msdn.microsoft.com/library/de...us/dnpag2/html
/paght000023.asp

http://msdn.microsoft.com/library/de...us/dnnetsec/ht
ml/SecNetch13.asp

Please feel free to let me know your test result or if you have any new
findings.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 1 '06 #3
Thanks for your reply Marc,

Yes, for ASP.NET application the running process account is the IIS6's
application pool identity. And you're right that if you use the Network
service account as the web application's process identity, you can avoid
registering the host name (SPN) for the web appliation service since by
default the network service account(can represent machine account) has two
SPNs associated with it,(the netbious computer name and the full qualified
dns name) you can verify this through the setspn.exe tool. However, if you
want to use other custom host name or DNS name for the web application
site, you need to register that hostname as SPN in AD also.

As for the WindowsIdentity you mentioned, have you checked its
"Authentication Type" property? Is it Negotiate or NTML?

Not sure whether you've already read the following reference. here is a
complete troubleshooting reference about kerberos delegation:

#Troubleshootin g Kerberos Delegation
http://www.microsoft.com/technet/pro.../technologies/
security/tkerbdel.mspx

You can also download a local version:

http://www.microsoft.com/downloads/d...94f-e28a-4726-
bffe-2f64ae2f59a2&di splaylang=en

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 2 '06 #4
Thanks for the reply, at least I am sure I have that setup correctly.
Also, I did go ahead and try a custom domain application account as the
application pool identity as well. After registering the SPNs for that
account and granting the custom domain account delegation permissions I
received the same access denied error.

As to your Authentication Type question, here are my results after
impersonation has taken place:

..GetCurrentUse rName: {DOMAIN}\{USER} (Currently logged in user)
..Authenticatio nType: Kerberos
..Impersonation Level: Impersonation

I have not seen this Kerberos Delegation troubleshooting document. Thank
you for pointing it out. I will go through this and see if I can find out
what I am doing incorrectly. Should I come across any questions I will
continue to ask them here.

Thank you for your help,

- Marc Castrechini

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:jI******** ******@TK2MSFTN GXA01.phx.gbl.. .
Thanks for your reply Marc,

Yes, for ASP.NET application the running process account is the IIS6's
application pool identity. And you're right that if you use the Network
service account as the web application's process identity, you can avoid
registering the host name (SPN) for the web appliation service since by
default the network service account(can represent machine account) has two
SPNs associated with it,(the netbious computer name and the full qualified
dns name) you can verify this through the setspn.exe tool. However, if
you
want to use other custom host name or DNS name for the web application
site, you need to register that hostname as SPN in AD also.

As for the WindowsIdentity you mentioned, have you checked its
"Authentication Type" property? Is it Negotiate or NTML?

Not sure whether you've already read the following reference. here is a
complete troubleshooting reference about kerberos delegation:

#Troubleshootin g Kerberos Delegation
http://www.microsoft.com/technet/pro.../technologies/
security/tkerbdel.mspx

You can also download a local version:

http://www.microsoft.com/downloads/d...94f-e28a-4726-
bffe-2f64ae2f59a2&di splaylang=en

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 2 '06 #5
Thanks for your followup Marc,

Yes, the doc has a complete TS list. Also, at the end of the document, it
has mentioned using network tracing to check the kerberos authentication,
this will be very helpful to verify whether the kerberos ticket has been
successfully be forwarded from client to middle server and backend.

Please feel free to post here if you get any update.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 3 '06 #6
Hello Marc,

How are you doing on this issue, have you got any progress? Please feel
free to let me know if there is still anything we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 7 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1158
by: Marvin | last post by:
We have an ASP.Net application that is being stored on a file share seperate from the IIS server machine. The application has been designed to use NT authentication (via User.Identity.Name) to control user access and security We have IIS configured to list the site as a virtual directory under the website and a special "Connect As" user account and password was entered The Problem: On development (with no file share), User.Identity.Name...
8
9769
by: Michelle | last post by:
Hello! I have an ASP.NET application (1.1 framework) that needs to be able to read/write files on a network share. The access to this file share will be fairly restricted, so I need to impersonate a specific user account on our domain in order to gain access. The impersonation is only needed for the sections that reads/writes files. I have tried using the code from http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q306158#4 and...
23
2904
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the same NT domain, each one has its own web server. The web server is always IIS 5.0.
5
4799
by: Rosa | last post by:
Hi, I'm experiencing a bit of a problem with security and file access from within a ASP.Net application... Locally (from an XP client) I manage to get any file or folder on my machine with something similar to this: DirectoryInfo di = new DirectoryInfo(strURL); if(di.Exists) { FileInfo fileList = di.GetFiles();
4
8543
by: Ravikanth[MVP] | last post by:
Hi It is possible that IIS and SQL Server can reside on Seperate Machines and you can use Integrated Windows Authentication to connect. Ravikanth >-----Original Message-----
2
3571
by: Stu | last post by:
Using IIs 6.0 on a Server 2003 box, and using ASP.NET I'm trying to do the following code snippit... Dim NewName As String = "\\network_share_path\edit_me.ppt" Dim PubName As String = "\\network_share_path\show_me.ppt" Dim PubFile As System.IO.File If PubFile.Exists(PubName) Then
1
1335
by: Robin Patra | last post by:
Hi All, We have the following scenerio. Machine 1: webservice is deployed in this machine. Machine 2: UserControl is deployed in this machine. Case 1: Now my requirement is a person from Machine 3 types (http://servername(machine 2)/myusercontrol.aspx.
7
3028
by: Alice Wong | last post by:
I am setting up my Web ASP.net application to connect to Sql server using windows authentication. I set up IIS to have integrated windows authenication and sql to allow Windows authentication. And I trun annonymous login. I use this connection to connect. server={0};database={1};Integrated Security=SSPI where {0} servname and {1} database name
0
1045
by: scomik | last post by:
Hello, Is Kerberos delegation needed to write a file from a web app to a file server within the same network? If so, I will be setting up constrained delegation. The problem is what is the service on the file server that I will let the web service account use?
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.