473,545 Members | 1,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Security- access to Event Viewer

I have the following code, which regardless which works fine and logs to the
EventViewer regardless of whether
<processModel/> section of machine.config is set to username="SYSTE M" or
"machine"

---Start of test.aspx----
<%@ Page language="C#" AutoEventWireup ="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title> test</title>
</HEAD>

<body>
<%

try
{
System.Diagnost ics.EventLog objEventLog;

if (!System.Diagno stics.EventLog. SourceExists("T ESTSOURCE"))
{

System.Diagnost ics.EventLog.Cr eateEventSource ("TESTSOURCE"," Application");
}

objEventLog = new System.Diagnost ics.EventLog();
objEventLog.Sou rce = "TESTSOURCE ";
if ( objEventLog.Log .ToUpper() != "APPLICATIO N" )
{
System.Console. WriteLine("Some other application is
using the source!");
return;
}

objEventLog.Wri teEntry("Messag e",
System.Diagnost ics.EventLogEnt ryType.Error);

}
catch (Exception e)
{
%>
<%=e%>

<%
} //end try
%>
</body>
</HTML>
----End of test.aspx----
However, if I have some very similar code in a Logging.cs file as follows:

--Start of logging.cs--
using System;
using System.Diagnost ics;

namespace website.classes
{


public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

if (!EventLog.Sour ceExists(EVENT_ SOURCE))
{
EventLog.Create EventSource(EVE NT_SOURCE,EVENT _LOG);
}

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
if ( objEventLog.Log .ToUpper() != EVENT_LOG.ToUpp er() )
{
System.Console. WriteLine("Some other application is
using the source!");
return;
}

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

} //end class Logging
}
---end of logging.cs--

then, whenver I try to call from ASPX Logging.LogErro r("an error message"),
I got an error, and when I debug the code, I found that it is failing on the
call to EventLog.Source Exists.
{"Requested registry access is not allowed." }
[System.Security .SecurityExcept ion]: {"Requested registry access is not
allowed."}
System.Object: {System.Securit y.SecurityExcep tion}
_className: null
_COMPlusExcepti onCode: -532459699
_exceptionMetho d: <undefined value>
_exceptionMetho dString: null
_helpURL: null
_HResult: -2146233078
_innerException : { }
_message: "Requested registry access is not allowed."
_remoteStackInd ex: 0
_remoteStackTra ceString: null
_source: null
_stackTrace: {System.Array}
_stackTraceStri ng: null
_xcode: -532459699
_xptrs: 0
HelpLink: null
HResult: -2146233078
InnerException: { }
Message: "Requested registry access is not allowed."
Source: "mscorlib"
StackTrace: " at Microsoft.Win32 .RegistryKey.Op enSubKey(String name,
Boolean writable)\r\n at
System.Diagnost ics.EventLog.Fi ndSourceRegistr ation(String source, String
machineName, Boolean readOnly)\r\n at
System.Diagnost ics.EventLog.So urceExists(Stri ng source, String
machineName)\r\ n at System.Diagnost ics.EventLog.So urceExists(Stri ng
source)\r\n at YJB_Website.cla sses.Logging.Lo gEventViewer(St ring
strMessage, EventLogEntryTy pe objLogEntryType ) in
c:\\inetpub\\ww wroot\\yjb_webs ite\\classes\\l ogging.cs:line 74"
TargetSite: {System.Reflect ion.RuntimeMeth odInfo}
The only way I could get this working is to set <processModel />,
userName="SYSTE M".

But this is not desirable as I don't want to high level of access. and I am
surprised why the code works when run from ASPX but not from a class? Note
also I also have the following settings on machine.config
<identity impersonate="fa lse" userName="Domai n\user"
password="passw ord"/>
Nov 18 '05 #1
29 15485
Solution:
- either do not specify an event source and your information will be written
to the application event log*
or
- give the aspnet worker process account administrative rights to the local
machine.
You can read more about it here, in this KB article:
PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET
Application Tries to Write New EventSource in the EventLog
http://support.microsoft.com/default...Product=aspnet

In general, http://support.microsoft.com/support is a good place to start
for troubleshooting such matters

*If you already have your custom event source created in the event viewer,
you may be able to write to it w/o admin privileges. IIRC, this may no
longer be the case with .Net v 1.1. a simple test can confirm this.

Hope this helps. Good luck

--
Peter O'Reilly
Nov 18 '05 #2
Does't quite work!

I have done both of what is listed under
http://support.microsoft.com/default...Product=aspnet .

Having tried first approach on the Microsoft article, it doesn't work, so I
deleted the Key and tried second approach. Second approach does the same as
first approach, except that that under
HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\Application\T e
st, it created a String Key called EventMessageFil e, pointing to
C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Ev entLogMessages. dll (this is on
Win2K SP4)

According to my Trace, the call to .WriteEvent failed with:
System.InvalidO perationExcepti on: Cannot open log for source {0}. You may
not have write access. ---> System.Componen tModel.Win32Exc eption: Access is
denied
--- End of inner exception stack trace ---
at System.Diagnost ics.EventLog.Op enForWrite()
at System.Diagnost ics.EventLog.Wr iteEvent(Int32 eventID, Int16 category,
EventLogEntryTy pe type, String[] strings, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID, Int16 category)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type)
at Website.classes .Logging.LogEve ntViewer(String strMessage,
EventLogEntryTy pe objLogEntryType )System.Invalid OperationExcept ion: Cannot
open log for source {0}. You may not have write access. --->
System.Componen tModel.Win32Exc eption: Access is denied

giving write+modify permission to IWAM_MachineNam e for
c:\winnt\system 32\config\AppEv ent.evt does not help solving the problem
either!

The code snipet is as follows:
try
{
EventLog objEventLog;
objEventLog = new EventLog();
objEventLog.Log = "Applicatio n";
objEventLog.Sou rce = "TEST";
if ( objEventLog.Log .ToUpper() != "APPLICATIO N")
{
System.Console. WriteLine("Some other application is
using the source!");
return;
}
objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{
Trace.Write(e);
System.Console. WriteLine(e);
return;
} //end try

"Peter O'Reilly" <Pe***********@ timeinc.com!N!O !.S!P!AM!> wrote in message
news:u7******** ******@TK2MSFTN GP09.phx.gbl...
Solution:
- either do not specify an event source and your information will be written to the application event log*
or
- give the aspnet worker process account administrative rights to the local machine.
You can read more about it here, in this KB article:
PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET
Application Tries to Write New EventSource in the EventLog
http://support.microsoft.com/default...Product=aspnet
In general, http://support.microsoft.com/support is a good place to start
for troubleshooting such matters

*If you already have your custom event source created in the event viewer,
you may be able to write to it w/o admin privileges. IIRC, this may no
longer be the case with .Net v 1.1. a simple test can confirm this.

Hope this helps. Good luck

--
Peter O'Reilly

Nov 18 '05 #3
Hi Patrick,

I have tested the test.aspx file and the code in Logging.cs. By default
both failed.

Actually, if an web application must create a new event log category, the
application must create a registry key under the HKEY_LOCAL_MACH INE
registry hive, which the ASPNET account cannot do (If we set
username="machi ne", the ASP.NET web application run with the "ASPNET"
account).

To create the category at run time, you must enable impersonation, and then
you must impersonate an account that has more access rights. Alternatively,
an administrator can create the category, and the application can write to
the category at run time.

I have created one sample for reference. Before creating the new event log
category, I impersonate in the code to the local administrator. After the
new event log category is created, I convert the account to ASPNET again.

The following is the list for the code behind the page:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
using System.Security .Principal;
using System.Runtime. InteropServices ;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

if (!EventLog.Sour ceExists(EVENT_ SOURCE))
{
WindowsImperson ationContext wic = CreateIdentity( "administrator" ,
"machinenam e", "password").Imp ersonate();

EventLog.Create EventSource(EVE NT_SOURCE,EVENT _LOG);

wic.Undo();
}

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
if ( objEventLog.Log .ToUpper() != EVENT_LOG.ToUpp er() )
{
System.Console. WriteLine("Some other application is using the
source!");
return;
}

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

protected static WindowsIdentity CreateIdentity( string User, string
Domain, string Password)
{
// The Windows NT user token.
IntPtr tokenHandle = new IntPtr(0);

const int LOGON32_PROVIDE R_DEFAULT = 0;
const int LOGON32_LOGON_N ETWORK = 3;

tokenHandle = IntPtr.Zero;

// Call LogonUser to obtain a handle to an access token.
bool returnValue = LogonUser(User, Domain, Password,
LOGON32_LOGON_N ETWORK, LOGON32_PROVIDE R_DEFAULT,
ref tokenHandle);

if (false == returnValue)
{
int ret = Marshal.GetLast Win32Error();
throw new Exception("Logo nUser failed with error code: " + ret);
}

System.Diagnost ics.Debug.Write Line("Created user token: " + tokenHandle);

//The WindowsIdentity class makes a new copy of the token.
//It also handles calling CloseHandle for the copy.
WindowsIdentity id = new WindowsIdentity (tokenHandle);
CloseHandle(tok enHandle);
return id;
}

[DllImport("adva pi32.dll", SetLastError=tr ue)]
private static extern bool LogonUser(Strin g lpszUsername, String
lpszDomain, String lpszPassword,
int dwLogonType, int dwLogonProvider , ref IntPtr phToken);

[DllImport("kern el32.dll", CharSet=CharSet .Auto)]
private extern static bool CloseHandle(Int Ptr handle);

} //end class Logging
}

If there is any problem, feel free to let me know.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #4
Hi Steven,

thanks for your help, but my points are
1) I have followed the first and second approach stated in
http://support.microsoft.com/default...Product=aspnet
to create the event source TEST under the Applicaiton Log. The second
approach, is more advanced in that it create a String Key EventMessageFil e
pointing to C:\WINNT\Micros oft.NET\Framewo rk\v1.1.4322\Ev entLogMessages. dll
(this is on Win2K SP4). Is this not good enough? Is there any reason why
the Event Source has to be created in *run time*?
2) Note, I am no longer calling CreateEventSour ce anymore, but the call to
WriteEvent is failing as stated in my earlier post.
3) With test.aspx on a Win2K SP4, it works if I set machine.aspx to
impersonate as an account with local administrative rights and does IISRESET
4) With test.aspx on the same Win2K SP4, it stopped working immediately if I
stop using impersonation and IISRESET

Hence, I got a big suspicion that the problem is with access to the Event
Viewer itself!

Note, even if I grante Read, Read+Execute, Write and Modify permissions to
"MyDomain\Authe nticated Users" to C:\WINNT\system 32\config\AppEv t.cfg,
test.aspx is still failing without impersonation and note- I do *Not* wrong
to run my ASP.NET application as an administrative user!

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:fc******** ******@cpmsftng xa10.phx.gbl...
Hi Patrick,

I have tested the test.aspx file and the code in Logging.cs. By default
both failed.

Actually, if an web application must create a new event log category, the
application must create a registry key under the HKEY_LOCAL_MACH INE
registry hive, which the ASPNET account cannot do (If we set
username="machi ne", the ASP.NET web application run with the "ASPNET"
account).

To create the category at run time, you must enable impersonation, and then you must impersonate an account that has more access rights. Alternatively, an administrator can create the category, and the application can write to
the category at run time.

I have created one sample for reference. Before creating the new event log
category, I impersonate in the code to the local administrator. After the
new event log category is created, I convert the account to ASPNET again.

The following is the list for the code behind the page:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
using System.Security .Principal;
using System.Runtime. InteropServices ;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

if (!EventLog.Sour ceExists(EVENT_ SOURCE))
{
WindowsImperson ationContext wic = CreateIdentity( "administrator" ,
"machinenam e", "password").Imp ersonate();

EventLog.Create EventSource(EVE NT_SOURCE,EVENT _LOG);

wic.Undo();
}

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
if ( objEventLog.Log .ToUpper() != EVENT_LOG.ToUpp er() )
{
System.Console. WriteLine("Some other application is using the
source!");
return;
}

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

protected static WindowsIdentity CreateIdentity( string User, string
Domain, string Password)
{
// The Windows NT user token.
IntPtr tokenHandle = new IntPtr(0);

const int LOGON32_PROVIDE R_DEFAULT = 0;
const int LOGON32_LOGON_N ETWORK = 3;

tokenHandle = IntPtr.Zero;

// Call LogonUser to obtain a handle to an access token.
bool returnValue = LogonUser(User, Domain, Password,
LOGON32_LOGON_N ETWORK, LOGON32_PROVIDE R_DEFAULT,
ref tokenHandle);

if (false == returnValue)
{
int ret = Marshal.GetLast Win32Error();
throw new Exception("Logo nUser failed with error code: " + ret);
}

System.Diagnost ics.Debug.Write Line("Created user token: " + tokenHandle);

//The WindowsIdentity class makes a new copy of the token.
//It also handles calling CloseHandle for the copy.
WindowsIdentity id = new WindowsIdentity (tokenHandle);
CloseHandle(tok enHandle);
return id;
}

[DllImport("adva pi32.dll", SetLastError=tr ue)]
private static extern bool LogonUser(Strin g lpszUsername, String
lpszDomain, String lpszPassword,
int dwLogonType, int dwLogonProvider , ref IntPtr phToken);

[DllImport("kern el32.dll", CharSet=CharSet .Auto)]
private extern static bool CloseHandle(Int Ptr handle);

} //end class Logging
}

If there is any problem, feel free to let me know.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #5
Also, with reference to
http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg

how come someone managed to do something very similar to what I am trying to
do, but I can't?!
:'(
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:fc******** ******@cpmsftng xa10.phx.gbl...
Hi Patrick,

I have tested the test.aspx file and the code in Logging.cs. By default
both failed.

Actually, if an web application must create a new event log category, the
application must create a registry key under the HKEY_LOCAL_MACH INE
registry hive, which the ASPNET account cannot do (If we set
username="machi ne", the ASP.NET web application run with the "ASPNET"
account).

To create the category at run time, you must enable impersonation, and then you must impersonate an account that has more access rights. Alternatively, an administrator can create the category, and the application can write to
the category at run time.

I have created one sample for reference. Before creating the new event log
category, I impersonate in the code to the local administrator. After the
new event log category is created, I convert the account to ASPNET again.

The following is the list for the code behind the page:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
using System.Security .Principal;
using System.Runtime. InteropServices ;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

if (!EventLog.Sour ceExists(EVENT_ SOURCE))
{
WindowsImperson ationContext wic = CreateIdentity( "administrator" ,
"machinenam e", "password").Imp ersonate();

EventLog.Create EventSource(EVE NT_SOURCE,EVENT _LOG);

wic.Undo();
}

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
if ( objEventLog.Log .ToUpper() != EVENT_LOG.ToUpp er() )
{
System.Console. WriteLine("Some other application is using the
source!");
return;
}

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

protected static WindowsIdentity CreateIdentity( string User, string
Domain, string Password)
{
// The Windows NT user token.
IntPtr tokenHandle = new IntPtr(0);

const int LOGON32_PROVIDE R_DEFAULT = 0;
const int LOGON32_LOGON_N ETWORK = 3;

tokenHandle = IntPtr.Zero;

// Call LogonUser to obtain a handle to an access token.
bool returnValue = LogonUser(User, Domain, Password,
LOGON32_LOGON_N ETWORK, LOGON32_PROVIDE R_DEFAULT,
ref tokenHandle);

if (false == returnValue)
{
int ret = Marshal.GetLast Win32Error();
throw new Exception("Logo nUser failed with error code: " + ret);
}

System.Diagnost ics.Debug.Write Line("Created user token: " + tokenHandle);

//The WindowsIdentity class makes a new copy of the token.
//It also handles calling CloseHandle for the copy.
WindowsIdentity id = new WindowsIdentity (tokenHandle);
CloseHandle(tok enHandle);
return id;
}

[DllImport("adva pi32.dll", SetLastError=tr ue)]
private static extern bool LogonUser(Strin g lpszUsername, String
lpszDomain, String lpszPassword,
int dwLogonType, int dwLogonProvider , ref IntPtr phToken);

[DllImport("kern el32.dll", CharSet=CharSet .Auto)]
private extern static bool CloseHandle(Int Ptr handle);

} //end class Logging
}

If there is any problem, feel free to let me know.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #6
Note, my test.aspx works on IIS6 on Windows 2003 but not IIS5 on Windows
2000 with SP4, although the Windows 2000 SP4 server is a bit more locked
down. e.g. it has the the High Security Template for Domain Controller
(c:\winnt\secur ity\hisecdc.inf ) applied using the Security Configuration &
Analysis snap in. But note that the the ACL has been completely relaxed on
c:\winnt\system 32\config\AppEv t.cfg (the file for the Application Event
Log), to give everyone Full control to that file, but still no
joy!........... ............

"Patrick" <pa**@reply.new sgroup.msn.com> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl...
Also, with reference to
http://groups.google.com/groups?hl=e...3DN%26tab%3Dwg
how come someone managed to do something very similar to what I am trying to do, but I can't?!
:'(
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:fc******** ******@cpmsftng xa10.phx.gbl...
Hi Patrick,

I have tested the test.aspx file and the code in Logging.cs. By default
both failed.

Actually, if an web application must create a new event log category, the application must create a registry key under the HKEY_LOCAL_MACH INE
registry hive, which the ASPNET account cannot do (If we set
username="machi ne", the ASP.NET web application run with the "ASPNET"
account).

To create the category at run time, you must enable impersonation, and

then
you must impersonate an account that has more access rights.

Alternatively,
an administrator can create the category, and the application can write to the category at run time.

I have created one sample for reference. Before creating the new event log category, I impersonate in the code to the local administrator. After the new event log category is created, I convert the account to ASPNET again.
The following is the list for the code behind the page:

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
using System.Security .Principal;
using System.Runtime. InteropServices ;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

if (!EventLog.Sour ceExists(EVENT_ SOURCE))
{
WindowsImperson ationContext wic = CreateIdentity( "administrator" ,
"machinenam e", "password").Imp ersonate();

EventLog.Create EventSource(EVE NT_SOURCE,EVENT _LOG);

wic.Undo();
}

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
if ( objEventLog.Log .ToUpper() != EVENT_LOG.ToUpp er() )
{
System.Console. WriteLine("Some other application is using the
source!");
return;
}

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

protected static WindowsIdentity CreateIdentity( string User, string
Domain, string Password)
{
// The Windows NT user token.
IntPtr tokenHandle = new IntPtr(0);

const int LOGON32_PROVIDE R_DEFAULT = 0;
const int LOGON32_LOGON_N ETWORK = 3;

tokenHandle = IntPtr.Zero;

// Call LogonUser to obtain a handle to an access token.
bool returnValue = LogonUser(User, Domain, Password,
LOGON32_LOGON_N ETWORK, LOGON32_PROVIDE R_DEFAULT,
ref tokenHandle);

if (false == returnValue)
{
int ret = Marshal.GetLast Win32Error();
throw new Exception("Logo nUser failed with error code: " + ret);
}

System.Diagnost ics.Debug.Write Line("Created user token: " + tokenHandle);
//The WindowsIdentity class makes a new copy of the token.
//It also handles calling CloseHandle for the copy.
WindowsIdentity id = new WindowsIdentity (tokenHandle);
CloseHandle(tok enHandle);
return id;
}

[DllImport("adva pi32.dll", SetLastError=tr ue)]
private static extern bool LogonUser(Strin g lpszUsername, String
lpszDomain, String lpszPassword,
int dwLogonType, int dwLogonProvider , ref IntPtr phToken);

[DllImport("kern el32.dll", CharSet=CharSet .Auto)]
private extern static bool CloseHandle(Int Ptr handle);

} //end class Logging
}

If there is any problem, feel free to let me know.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #7
Hi Patrick,

Thanks for your effort and time!

I would like to restate the current status as following. Please check if I
understood the problem correctly.

1. Now you are directly calling "WriteEntry " to add the event to the Event
Log. However, the error message still appear.

2. When you use impersonation on the Windows 2000 SP4 machine, the
test.aspx page works fine. However, without impersonation, it will fail.

If I have misunderstood, please don't hesitate to let me know.

Patrick, as we have discussed, if we do not enable impersonation, the
default account (ASPNET on Windows 2000) for ASP.NET work process do not
have permission to create the new event log category. This is the cause for
the error message.

However, by default the account "ASPNET" has permission to add one event
item with "WriteEntry ". The following code also works fine on my side. Can
you help to double confirm with the following code on your side again?
Thanks for your help!

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

objEventLog = new EventLog();
objEventLog.Sou rce = "applicatio n";

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

} //end class Logging
}

If there are any new findings, please feel free to let me know. Thanks!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #8
I have added in some Trace code and changed the code to do the logging on
Page_Load and tested(code appended below).

Note, it works on a (not very locked down) Windows XP Professional SP2
running IIS5.1, but not on a fairly locked down Windows 2000 SP4 running
IIS5.0. The exceptions from trace is:
before writeSystem.Inv alidOperationEx ception: Cannot open log for source
{0}. You may not have write access. --->
System.Componen tModel.Win32Exc eption: Access is denied
--- End of inner exception stack trace ---
at System.Diagnost ics.EventLog.Op enForWrite()
at System.Diagnost ics.EventLog.Wr iteEvent(Int32 eventID, Int16 category,
EventLogEntryTy pe type, String[] strings, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID, Int16 category, Byte[] rawData)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID, Int16 category)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type, Int32 eventID)
at System.Diagnost ics.EventLog.Wr iteEntry(String message,
EventLogEntryTy pe type)
at eventtest.Loggi ng.LogEventView er(String strMessage, EventLogEntryTy pe
objLogEntryType )

What other security permissions are required just to write to the event
viewer?

As discussed, previously, on the win2K SP4 box
1) ACL has been completely relaxed on c:\winnt\system 32\config\AppEv t.cfg
(the file for the Application Event
Log), to give everyone Full control to that file
2) The Event Source was entered as a Key under
HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\Application\
3) it has the the High Security Template for Domain Controller
(c:\winnt\secur ity\hisecdc.inf ) applied using the Security Configuration &
Analysis MMC snap in.

What other security permissions are required just to write to the event
viewer? As you have suggested and as stated in
http://groups.google.com/groups?hl=e...ity%2520Permis
sion%2520Event% 2520Viewer%2520 write%2520windo ws%25202000%26h l%3Den%26lr%3D% 2
6ie%3DUTF-8%26oe%3DUTF-8%26sa%3DN%26ta b%3Dwg, the standard ASP.NET worker
process should have permission to write to the Event Viewer using an
existing event source!

-Standard Assembly.Info and Global.asax file with a ASP.NET C# Project in
Visual Studio 2003 Enterprise Architect version.
---start of webform1.aspx----
<%@ Page language="c#" Codebehind="Web Form1.aspx.cs" AutoEventWireup ="false"
Inherits="event test.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1 </title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING= "GridLayout ">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 168px;
POSITION: absolute; TOP: 112px" runat="server"
Text="test" Width="96px" Height="24px"></asp:Button>
</form>
</body>
</HTML>
---end of webform1.aspx----
---start of webform1.aspx.c s----
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;

namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{

protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
Logging.LogErro r("an error message");
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form
Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion
}

public class Logging
{
private const string EVENT_SOURCE = "TEST";
private const string EVENT_LOG = "Applicatio n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

objEventLog = new EventLog();
objEventLog.Sou rce = EVENT_SOURCE;
objEventLog.Log = EVENT_LOG;
Trace.Write("be fore write");

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

Trace.Write("af ter write");

}
catch (Exception e)
{
Trace.Write(e);
System.Console. WriteLine(e);
return;
} //end try
finally
{
Trace.Flush();
}

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

} //end class Logging
}
---end of webform1.aspx.c s----

---Start of Web.config---
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.diagnos tics>
<trace autoflush="true " indentsize="3">
<listeners>

<add name="myListene r"
type="System.Di agnostics.TextW riterTraceListe ner"
initializeData= "c:\\temp\\CMST raceFile.txt" />
<remove type="System.Di agnostics.Defau ltTraceListener "/>
</listeners>

</trace>
</system.diagnost ics>
<system.web>

<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to enable ASPX debugging. Otherwise,
setting this value to
false will improve runtime performance of this application.
Set compilation debug="true" to insert debugging symbols (.pdb
information)
into the compiled page. Because this creates a larger file that
executes
more slowly, you should set this value to true only when debugging
and to
false at all other times. For more information, refer to the
documentation about
debugging ASP.NET files.
-->
<compilation
defaultLanguage ="c#"
debug="true"
/>

<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly " to enable custom error
messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly " Display custom (friendly) messages only to users not
running
on the local Web server. This setting is recommended for security
purposes, so
that you do not display application detail information to remote
clients.
-->
<customErrors
mode="RemoteOnl y"
/>

<!-- AUTHENTICATION
This section sets the authentication policies of the application.
Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or
Integrated Windows) according to
its settings for the application. Anonymous access must be
disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter
their credentials, and then
you authenticate them in your application. A user credential
token is stored in a cookie.
"Passport" Authentication is performed via a centralized
authentication service provided
by Microsoft that offers a single logon and core profile services
for member sites.
-->
<authenticati on mode="Windows" />

<!-- AUTHORIZATION
This section sets the authorization policies of the application.
You can allow or deny access
to application resources by user or role. Wildcards: "*" mean
everyone, "?" means anonymous
(unauthenticate d) users.
-->

<authorizatio n>
<allow users="*" /> <!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page
within an application.
Set trace enabled="true" to enable application trace logging. If
pageOutput="tru e", the
trace information will be displayed at the bottom of each page.
Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your
web application
root.
-->
<trace
enabled="true"
requestLimit="1 0"
pageOutput="fal se"
traceMode="Sort ByTime"
localOnly="fals e"
/>

<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong
to a particular session.
If cookies are not available, a session can be tracked by adding a
session identifier to the URL.
To disable cookies, set sessionState cookieless="tru e".
-->
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data
source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>

<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalizatio n
requestEncoding ="utf-8"
responseEncodin g="utf-8"
/>

</system.web>

</configuration>
---End of web.config----

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:HM******** ******@cpmsftng xa10.phx.gbl...
Hi Patrick,

Thanks for your effort and time!

I would like to restate the current status as following. Please check if I
understood the problem correctly.

1. Now you are directly calling "WriteEntry " to add the event to the Event
Log. However, the error message still appear.

2. When you use impersonation on the Windows 2000 SP4 machine, the
test.aspx page works fine. However, without impersonation, it will fail.

If I have misunderstood, please don't hesitate to let me know.

Patrick, as we have discussed, if we do not enable impersonation, the
default account (ASPNET on Windows 2000) for ASP.NET work process do not
have permission to create the new event log category. This is the cause for the error message.

However, by default the account "ASPNET" has permission to add one event
item with "WriteEntry ". The following code also works fine on my side. Can
you help to double confirm with the following code on your side again?
Thanks for your help!

using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using System.Diagnost ics;
namespace eventtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Butt on Button1;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Button1.Cl ick += new System.EventHan dler(this.Butto n1_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void Button1_Click(o bject sender, System.EventArg s e)
{
Logging.LogErro r("an error message");

}
}

public class Logging
{
private const string EVENT_SOURCE = "YJBWEBSITE ";
private const string EVENT_LOG = "Applicaito n";

public Logging()
{
//Default constructor
}
public static void LogEventViewer( string
strMessage,Even tLogEntryType objLogEntryType )
{
try
{
EventLog objEventLog;

objEventLog = new EventLog();
objEventLog.Sou rce = "applicatio n";

objEventLog.Wri teEntry(strMess age,objLogEntry Type);

}
catch (Exception e)
{

System.Console. WriteLine(e);
return;
} //end try

} //end LogEventViewer
public static void LogError(string strMessage)
{
LogEventViewer( strMessage,Even tLogEntryType.E rror);
}

} //end class Logging
}

If there are any new findings, please feel free to let me know. Thanks!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #9
Environment- Windows 2000 SP4, IIS5.0, domain controller, .NET Framework
1.1, High Security Template for Domain Controller applied

Running- Microsoft Content Management Server 2002 SP1A (ASP.NET
application), ASP Application, SQL Server

What I have been doing
1) Testing with ASP.NET process Model, etc. to get ASP.NET to write to the
Event Viewer
2) Deploying a new COM+ which is used by a seperate ASP application (it
involves
2.1) removing serveral classes from COM+, restarting server, deleting old
DLL, copying over new DLL, installing new DLL
2.2) Changing Domain Security Policy to lock out accounts after 4 invalid
logons, secedit /refreshpolicy machine_policy

Now, everything have stopped working!
In System Log:
Event Type: Error
Event Source: DCOM
Event Category: None
User: N/A
Description:
DCOM got error "Overlapped I/O operation is in progress. " and was unable to
logon .\IWAM_YJBWEBLI VE in order to run the server:
{3D14228D-FBE1-11D0-995D-00C04FD919C1}

In Application Log:
Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1007
User: N/A
Description:
aspnet_wp.exe could not be launched because the username and/or password
supplied in the processModel section of the config file are invalid.

Event Type: Error
Event Source: ASP.NET 1.1.4322.0
Event Category: None
Event ID: 1084
User: N/A
Description:
aspnet_wp.exe could not be started. The error code for the failure is
80004005. This error can be caused when the worker process account has
insufficient rights to read the .NET Framework files. Please ensure that the
..NET Framework is correctly installed and that the ACLs on the installation
directory allow access to the configured account.

Research revealed that this could be caused by IWAM_machinenam e passwords
getting out of sync, I have reviewed:
http://support.microsoft.com/default...;en-us;Q296851
http://support.microsoft.com/?kbid=297989

I have reset password in AD for IWAM_MachineNam e, used adsutil.vbs to set
password of IWAM_MachineNam e to the password I set manually in AD

I tried to run cscript synciwam.vbs -v, but I get
Updating Applications:
Name: IIS-{www.youth-justice-board.gov.uk//ROOT/cgi-bin} Key:
{CB75A528-444A-484
A-83AF-4DA3849146A8}
Name: IIS-{Administration Web Site//ROOT/cgi-bin} Key:
{F7FF5789-0853-4BC8-BE09-
8057B84C15A3}
Name: IIS Out-Of-Process Pooled Applications Key:
{3D14228D-FBE1-11D0-995D-00C04
FD919C1}
Error: 80110414:

Also tried making IUSR_MachineNam e and IWAM_MachineNam e temporarily member
of Administrators group first, but still that does not allow the script to
run without error!

Now, I can't even run a simple test.asp or test.aspx with no code in it!
when I try to load test.asp, I get the DCOM error in system log. when I try
to load the test.aspx, I get the 2 asp.net error in the Applicaiton log

At present, machine.config is set to
1) no impersonation settings
2) processModel set to run as "machine" user

I could get ASP.NET pages running if I change processModel to run as
"SYSTEM" user, but this is not the settings I have on the live system.
Also, IWAM_MachineUse r does have full control to the "Temporary ASP.NET
Files" folder!

SOS !
Nov 18 '05 #10

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

Similar topics

22
2585
by: Alistair | last post by:
hello again oh knowledgable ones Today I took the plunge (more like a hell-hole dive) and upgraded to windows XP Pro.. and as I expected things are slightly different... what I didn't expect was for things to be so damn complicated!! I'm having trouble with my local DB sites. I keep getting "the file is read
1
3501
by: Mike | last post by:
Hi all, I'm trying to decide between two books for Oracle Financials security - there seem to be two obvious possibilities. The books are "Oracle E-Business Suite Financials Administrations" by Iyer, S., and "Oracle E-Business Suite Financials Handbook 2nd Edition" by James, D. Does anyone know if either is more useful from a security...
4
7966
by: Ashish | last post by:
Hi Guys I am getting the following error while implementing authentication using WS-security. "Microsoft.Web.Services2.Security.SecurityFault: The security token could not be authenticated or authorized ---> System.Exception: WSE565: The password provided the SecurityTokenManager does not match the one on the incoming token. at...
0
1511
by: prithvi g via .NET 247 | last post by:
Hi I am a newbie to .NET remoting, I am trying to implementauthorization using SSPI example provided by Michael Barnett. Ihave included the required dll(Microsoft.Samples.Security.SSPI.dll andMicrosoft.Samples.Runtime.Remoting. Security in both my clientand server. I have have defined my config files as follows for client <?xml...
5
2051
by: Norsoft | last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a dll which inherits from System.Windows.Forms.UserControl. It works fine on a PC with only the 1.1 Framework. However, the control will not load on a PC with the 2.0 Framework installed. I know that IE will use the newest framework so I assume it is a security issue. ...
4
3818
by: Henrik Skak Pedersen | last post by:
Hi, I have a set up where a windows client connects to a web service to retrieve a license file. The client is a consumer product which is beeing distributed to multiple locations. 1) I would like to restrict the web service so it only can be called from my application 2) I guess that I have to encrypt and sign all data which is being...
0
4311
by: Jay C. | last post by:
Jay 3 Jan. 11:38 Optionen anzeigen Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements Von: "Jay" <p.brunm...@nusurf.at> - Nachrichten dieses Autors suchen Datum: 3 Jan 2006 02:38:30 -0800 Lokal: Di 3 Jan. 2006 11:38 Betreff: Referenced security token could not be retrieved Antworten | Antwort an Autor | Weiterleiten...
2
2382
by: Budhi Saputra Prasetya | last post by:
Hi, I managed to create a Windows Form Control and put it on my ASP .NET page. I have done the suggestion that is provided by modifying the security settings. From the stack trace, I would assume that the code throws exception when it is trying to retrieve the processes list that has certain name. Below is the code that I use to retrieve...
8
13319
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service and hosted it in Windows Services. It is working fine. Now I am trying to implement the X509 certificates for message layer security. But it is throwing the following exception: An unhandled exception of type 'System.ServiceModel.Security.SecurityNegotiationException' occurred in mscorlib.dll
5
2742
by: VictorG | last post by:
Hello, I am trying to secure a webservice using WSE 3.0 and the turnkey usernameForCertificateSecurity profile. I am passing a valid username token, and on the server I have overridden the Authenticate token call and it is being called. My ASP.NET service has a Login() method and it is being called during client application startup....
0
7387
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...
0
7643
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. ...
0
7798
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...
0
7738
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5956
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4938
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
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...
0
3436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.