/
WebAuthenticationSuccessAuditEvent.xml
244 lines (205 loc) · 17.2 KB
/
WebAuthenticationSuccessAuditEvent.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<Type Name="WebAuthenticationSuccessAuditEvent" FullName="System.Web.Management.WebAuthenticationSuccessAuditEvent">
<TypeSignature Language="C#" Value="public class WebAuthenticationSuccessAuditEvent : System.Web.Management.WebSuccessAuditEvent" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit WebAuthenticationSuccessAuditEvent extends System.Web.Management.WebSuccessAuditEvent" />
<TypeSignature Language="DocId" Value="T:System.Web.Management.WebAuthenticationSuccessAuditEvent" />
<TypeSignature Language="VB.NET" Value="Public Class WebAuthenticationSuccessAuditEvent
Inherits WebSuccessAuditEvent" />
<TypeSignature Language="F#" Value="type WebAuthenticationSuccessAuditEvent = class
 inherit WebSuccessAuditEvent" />
<TypeSignature Language="C++ CLI" Value="public ref class WebAuthenticationSuccessAuditEvent : System::Web::Management::WebSuccessAuditEvent" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.Management.WebSuccessAuditEvent</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides information about successful authentication events.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
ASP.NET health monitoring allows production and operations staff to manage deployed Web applications. The <xref:System.Web.Management> namespace contains the health-event types responsible for packaging application health-status data and the provider types responsible for processing this data. It also contains supporting types that help during the management of health events.
The following list describes the features for which ASP.NET raises events of type <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent>.
> [!NOTE]
> By default ASP.NET is configured to log audit failure conditions only, as logging success conditions can severely strain system resources. You can always configure the system to log the success conditions.
- Forms Authentication. Successful conditions are audited. Success audits include the user name that was authenticated. Instead, failure audits do not include the user name, since they typically result from a ticket that failed decryption or validation. Both contain the client IP address. The related event audit code is <xref:System.Web.Management.WebEventCodes.AuditFormsAuthenticationSuccess>.
- Membership. Successful conditions are audited. Both success and failure audits contain the username that was attempted. Neither form of audit will contain the password that was attempted, because that would risk persisting a valid password in the log. The related event audit code is <xref:System.Web.Management.WebEventCodes.AuditMembershipAuthenticationSuccess>.
When a <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> is raised, by default it updates the Authentication Success Events Raised performance counter. To view this performance counter in System Monitor (PerfMon), in the **Add Counters** window select **ASP.NET** in the **Performance object** drop-down list, select the Authentication Success Events Raised performance counter, and click the **Add** button. For more information, see [Using the System Monitor (PerfMon) with ASP.NET Applications](https://docs.microsoft.com/previous-versions/windows/it-pro/windows-server-2003/cc784965(v=ws.10)).
> [!NOTE]
> In most cases you will be able to use the ASP.NET health-monitoring types as implemented, and you will control the health-monitoring system by specifying values in the `healthMonitoring` configuration section. You can also derive from the health-monitoring types to create your own custom events and providers. For an example of deriving from the <xref:System.Web.Management.WebBaseEvent> class, see the example provided in this topic.
## Examples
This code example has two parts: a configuration-file excerpt, followed by code that shows how to customize the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> event.
This following is an excerpt of the configuration file's `provider` and `eventMappings` sections. They are already set by default. The only thing you need to do is to provide the setup for the `rules` element in the `healthMonitoring` section.
```
<healthMonitoring
enabled="true"
heartBeatInterval="0">
<providers>
// Configure the provider to process
// the health events.
<add name="EventLogProvider"
type="System.Web.Management.EventLogWebEventProvider,
System.Web,Version=2.0.3600.0,Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
<eventMappings>
<clear />
// Configure the custom event
// to handle the audit events.
<add name="SampleWebAuthenticationSuccessAuditEvent"
type="SamplesAspNet.SampleWebAuthenticationSuccessAuditEvent,
webauthsuccessaudit, Version=1.0.1735.23144, Culture=neutral,
PublicKeyToken=dd969eda3f3f6ae1, processorArchitecture=MSIL" />
</eventMappings>
<rules>
<clear/>
// Establish the connection between custom event
// and the provider that must process it.
<add name="Log Authentication Success Audits"
eventName="SampleWebAuthenticationFailureAuditEvent"
provider="EventLogProvider"
profile="Custom" />\
</rules>
</healthMonitoring>
```
The following code shows how to customize the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> event.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/VB/WebAuthenticationSuccessAuditEvent.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.Management.WebAuthenticationFailureAuditEvent" />
<altmember cref="T:System.Web.Management.WebEventCodes" />
<related type="Article" href="https://msdn.microsoft.com/library/e003f224-70fe-4cd8-a71a-2dc81e2d7e4c">ASP.NET Health Monitoring Overview</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.Management.WebAuthenticationSuccessAuditEvent" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected internal WebAuthenticationSuccessAuditEvent (string message, object eventSource, int eventCode, string nameToAuthenticate);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig specialname rtspecialname instance void .ctor(string message, object eventSource, int32 eventCode, string nameToAuthenticate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Management.WebAuthenticationSuccessAuditEvent.#ctor(System.String,System.Object,System.Int32,System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, nameToAuthenticate As String)" />
<MemberSignature Language="F#" Value="new System.Web.Management.WebAuthenticationSuccessAuditEvent : string * obj * int * string -> System.Web.Management.WebAuthenticationSuccessAuditEvent" Usage="new System.Web.Management.WebAuthenticationSuccessAuditEvent (message, eventSource, eventCode, nameToAuthenticate)" />
<MemberSignature Language="C++ CLI" Value="protected public:
 WebAuthenticationSuccessAuditEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, System::String ^ nameToAuthenticate);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="eventSource" Type="System.Object" />
<Parameter Name="eventCode" Type="System.Int32" />
<Parameter Name="nameToAuthenticate" Type="System.String" />
</Parameters>
<Docs>
<param name="message">The event description.</param>
<param name="eventSource">The object that is the source of the event.</param>
<param name="eventCode">The code associated with the event. When you implement a custom event, the event code must be greater than <see cref="F:System.Web.Management.WebEventCodes.WebExtendedBase" />.</param>
<param name="nameToAuthenticate">The name of the authenticated user.</param>
<summary>Initializes the <see cref="T:System.Web.Management.WebAuthenticationSuccessAuditEvent" /> class using the supplied parameters.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is used internally by the ASP.NET health-monitoring system. You will never use it to instantiate a <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> object, but you can call this constructor when implementing your own event type that inherits from this class.
> [!NOTE]
> The <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent.%23ctor%2A> constructor is not intended to be used directly from your code. It is called by ASP.NET. You can call the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent.%23ctor%2A> constructor when deriving from the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> class.
## Examples
The following code example shows how to customize this constructor.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/VB/WebAuthenticationSuccessAuditEvent.vb" id="Snippet2":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected internal WebAuthenticationSuccessAuditEvent (string message, object eventSource, int eventCode, int eventDetailCode, string nameToAuthenticate);" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig specialname rtspecialname instance void .ctor(string message, object eventSource, int32 eventCode, int32 eventDetailCode, string nameToAuthenticate) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Management.WebAuthenticationSuccessAuditEvent.#ctor(System.String,System.Object,System.Int32,System.Int32,System.String)" />
<MemberSignature Language="VB.NET" Value="Protected Friend Sub New (message As String, eventSource As Object, eventCode As Integer, eventDetailCode As Integer, nameToAuthenticate As String)" />
<MemberSignature Language="F#" Value="new System.Web.Management.WebAuthenticationSuccessAuditEvent : string * obj * int * int * string -> System.Web.Management.WebAuthenticationSuccessAuditEvent" Usage="new System.Web.Management.WebAuthenticationSuccessAuditEvent (message, eventSource, eventCode, eventDetailCode, nameToAuthenticate)" />
<MemberSignature Language="C++ CLI" Value="protected public:
 WebAuthenticationSuccessAuditEvent(System::String ^ message, System::Object ^ eventSource, int eventCode, int eventDetailCode, System::String ^ nameToAuthenticate);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="eventSource" Type="System.Object" />
<Parameter Name="eventCode" Type="System.Int32" />
<Parameter Name="eventDetailCode" Type="System.Int32" />
<Parameter Name="nameToAuthenticate" Type="System.String" />
</Parameters>
<Docs>
<param name="message">The event description.</param>
<param name="eventSource">The object that is the source of the event.</param>
<param name="eventCode">The code associated with the event. When you implement a custom event, the event code must be greater than <see cref="F:System.Web.Management.WebEventCodes.WebExtendedBase" />.</param>
<param name="eventDetailCode">The <see cref="T:System.Web.Management.WebEventCodes" /> value that specifies the detailed identifier for the event.</param>
<param name="nameToAuthenticate">The name of the authenticated user.</param>
<summary>Initializes the <see cref="T:System.Web.Management.WebSuccessAuditEvent" /> class using the supplied parameters.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is used internally by the ASP.NET health-monitoring system. You will never use it to instantiate a <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> object, but you can call this constructor when implementing your own event type that inherits from this class.
> [!NOTE]
> The <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent.%23ctor%2A> constructor is not intended to be used directly from your code. It is called by ASP.NET. You can call the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent.%23ctor%2A> constructor when deriving from the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent> class.
## Examples
The following code example shows how to customize this constructor.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/VB/WebAuthenticationSuccessAuditEvent.vb" id="Snippet3":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="NameToAuthenticate">
<MemberSignature Language="C#" Value="public string NameToAuthenticate { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string NameToAuthenticate" />
<MemberSignature Language="DocId" Value="P:System.Web.Management.WebAuthenticationSuccessAuditEvent.NameToAuthenticate" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property NameToAuthenticate As String" />
<MemberSignature Language="F#" Value="member this.NameToAuthenticate : string" Usage="System.Web.Management.WebAuthenticationSuccessAuditEvent.NameToAuthenticate" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::String ^ NameToAuthenticate { System::String ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the name of the authenticated user.</summary>
<value>The name of the authenticated user.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Only the success audits include the name of the authenticated user. The failure audits do not include the user name, since they typically result from failed decryption or validation.
## Examples
The following code example shows how to use the <xref:System.Web.Management.WebAuthenticationSuccessAuditEvent.NameToAuthenticate%2A> property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/CS/WebAuthenticationSuccessAuditEvent.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/system.web.management.WebAuthenticationSuccessAuditEvent/VB/WebAuthenticationSuccessAuditEvent.vb" id="Snippet3":::
]]></format>
</remarks>
<altmember cref="T:System.Web.Management.WebAuthenticationFailureAuditEvent" />
<altmember cref="T:System.Web.Management.WebEventCodes" />
</Docs>
</Member>
</Members>
</Type>