Re: Impersonation with EventLog access Help!

From: Paul Glavich [MVP - ASP.NET] (glav_at_aspalliance.com-NOSPAM)
Date: 03/25/04


Date: Thu, 25 Mar 2004 22:04:16 +1100

I beleive this is the double hop scenario and is normal behaviour. You have
an ASP.NET app that is impersonating a user (in this case you). You then
want ASP.NET/this machine to flow those impersonated credentials to another
machine to use for authentication, to access another service. This is called
delegation and is only possible using Kerberos (ie. Win2000 or greater) and
enabling delegation for that account (in this case yours). Win2003 has a
feature called constrained delegation which is basically the same, but
offers finer grained access for delegation purposes.

- Paul Glavich

"Craig" <anonymous@discussions.microsoft.com> wrote in message
news:164C8645-6924-41B2-96AB-D0B250AAE579@microsoft.com...
> I've seen this same question in several forms but it never really seems to
get answered based on my research. Maybe I'm just missing it.
>
> I am trying to do a simple webpage that will read the EventLog from a
remote server. I have impersonation on, Windows Authentication on, IIS is
set to Integrated Windows Authentication only, etc. From my machine, I can
access the remote eventlog through Event Viewer fine and I can also get the
eventlog data through my new web page on the local server fine. From my 2nd
machine, which is logged in with the exact same credentials, if I hit the
same web page on my other machine then I get an error: "Access to the
registry key is denied."
>
> StackTrace " at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode,
String str)
> at Microsoft.Win32.RegistryKey.OpenRemoteBaseKey(RegistryHive hKey,
String machineName)
> at System.Diagnostics.EventLog.Exists(String logName, String
machineName)
> at System.Diagnostics.EventLog.OpenForRead()
> at System.Diagnostics.EventLog.get_EntryCount()
> at System.Diagnostics.EventLogEntryCollection.get_Count()
> at ReadEvents.WebForm1.GetEventData(String strServer, DateTime
startdate) in D:\MyProjects\TDWeb\ReadEvents\ReadEvents.aspx.vb:line 94"
String
>
> I have rights to read the Event Log obviously, but I'm not an
administrator. I don't know what registry key it's trying to access, but I
don't understand what is going on here. It's the exact same credentials just
from a different machine. When I check the CurrentUser, it shows my domain
and user name correctly.
>
> Any help would be great. Thanks in advance.
>



Relevant Pages

  • Re: Delegatoin w/ Protocol transition in a Windows 2000 native domain
    ... authentication is the only box checked) on the Exchange 2003 /exchange ... frontend-server by means of impersonating the user who's logged on ... This account is trusted for delegation. ... system" privelege on the ASP.NET server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: asp.net impersonation
    ... I U:\ mapped with the same user you are impersonating? ... I pass an xml string to a web service ... > Dim impersonationContext As WindowsImpersonationContext ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Delegatoin w/ Protocol transition in a Windows 2000 native domain
    ... The ASP.NET application needs delegated access to the exchange ... This account is trusted for delegation. ... system" privelege on the ASP.NET server. ... While impersonating I query the Exchange 2003-frontend server with ...
    (microsoft.public.win2000.active_directory)
  • File and Windows Service access from Web Application
    ... I'm 'Impersonating' a more powerful user. ... lpszUsername, String lpszDomain, String lpszPassword, ... dwFlags, ref IntPtr lpSource, ... ptrlpSource, errorCode, 0, ref lpMsgBuf, messageSize, ...
    (microsoft.public.dotnet.security)
  • Re: Remote file access while impersonating with NTLM
    ... if you are impersonating, you are impersonating - you had to write code to do that - and you have to remove code to stop it - but maybe i am wrong.... ... Kerberos will be implemented in a future release. ... Good point is to use delegation. ... with the service account's network credentials. ...
    (microsoft.public.dotnet.security)