469,573 Members | 1,642 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,573 developers. It's quick & easy.

Problem with impersonation..

Hi All,

I have some question which is related to my scenario, web application is running on windows 2003 server (Server 1) which is a domain controller.

i have created domain users with the administrator level permission.

in the IIS only integrated windows authentication is enabled. and in web.config

<identity impersonate="false" />

and i am impersonating the user in the below code:

Expand|Select|Wrap|Line Numbers
  1.  Public Sub Impersonation()
  3.  Dim identity As String = System.Security.Principal.WindowsIdentity.GetCurrent().Name
  4.         Dim slash As Integer = identity.IndexOf("\")
  5.         If slash > 0 Then
  6.             Dim domain As String = identity.Substring(0, slash)
  7.             Dim user As String = identity.Substring(slash + 1)
  8.             identity = user + "@" + domain
  9.         End If
  11.         Dim wi As New WindowsIdentity(identity)
  12.         Dim wic As WindowsImpersonationContext = Nothing
  14.         Try
  15.             wic = wi.Impersonate()
  17.         // for Access the files code goes here         
  19.         Catch
  20.             ' Prevent exceptions from propagating 
  21.         Finally
  22.             ' Revert impersonation 
  23.             If wic IsNot Nothing Then
  24.                 wic.Undo()
  25.             End If
  26.         End Try
  28.   End Sub
now i have another server running windows 2003 (Server 2) where i have added the domain user as a part of administrator group.
now i am running the application by using domain user.

My question is :

1) what other configuration i have to do to access the files from server 2 thorugh application.

2) in this scenario do i need to use 'Kerberos authentication and delegation'.

Thanks in advance

Jul 23 '08 #1
0 777

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Stephane Belzile | last post: by
1 post views Thread by Ripa Horatiu | last post: by
7 posts views Thread by Ram P. Dash | last post: by
3 posts views Thread by Robm | last post: by
reply views Thread by Zdenek Drlik | last post: by
reply views Thread by Rob Roberts | last post: by
1 post views Thread by Patrick | last post: by
reply views Thread by velvet.graham | last post: by
5 posts views Thread by =?Utf-8?B?S2l0dHlIYXdr?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.