/
FormsAuthenticationEventArgs.xml
173 lines (152 loc) · 12.3 KB
/
FormsAuthenticationEventArgs.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
<Type Name="FormsAuthenticationEventArgs" FullName="System.Web.Security.FormsAuthenticationEventArgs">
<TypeSignature Language="C#" Value="public sealed class FormsAuthenticationEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit FormsAuthenticationEventArgs extends System.EventArgs" />
<TypeSignature Language="DocId" Value="T:System.Web.Security.FormsAuthenticationEventArgs" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class FormsAuthenticationEventArgs
Inherits EventArgs" />
<TypeSignature Language="F#" Value="type FormsAuthenticationEventArgs = class
 inherit EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class FormsAuthenticationEventArgs sealed : EventArgs" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides data for the **FormsAuthentication_OnAuthenticate** event. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Security.FormsAuthenticationEventArgs> class is used to supply event values to the **FormsAuthentication_OnAuthenticate** event and to enable you to specify a custom identity for the current request.
The <xref:System.Web.Security.FormsAuthenticationModule> constructs a <xref:System.Web.Security.FormsAuthenticationEventArgs> object using the current <xref:System.Web.HttpContext> and passes it to the **FormsAuthentication_OnAuthenticate** event.
You can use the <xref:System.Web.Security.FormsAuthenticationEventArgs.User%2A> property to set the <xref:System.Web.HttpContext.User%2A> property of the current <xref:System.Web.HttpContext> to a custom <xref:System.Security.Principal.IPrincipal> object.
If you do not specify a value for the <xref:System.Web.Security.FormsAuthenticationEventArgs.User%2A> property during the **FormsAuthentication_OnAuthenticate** event, the identity supplied by the forms authentication ticket in the cookie or URL is used.
The **FormsAuthentication_OnAuthenticate** event is only raised when the authentication <xref:System.Web.Configuration.AuthenticationSection.Mode%2A> is set to <xref:System.Web.Configuration.AuthenticationMode.Forms> and the <xref:System.Web.Security.FormsAuthenticationModule> is an active HTTP module for the application.
## Examples
The following code example uses the **FormsAuthentication_OnAuthenticate** event to set the <xref:System.Web.HttpContext.User%2A> property of the current <xref:System.Web.HttpContext> to a <xref:System.Security.Principal.GenericPrincipal> object with a custom <xref:System.Security.Principal.IPrincipal.Identity%2A>.
[!code-csharp[System.Web.Security.FormsAuthenticationModule#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.FormsAuthenticationModule/CS/global.asax#1)]
[!code-vb[System.Web.Security.FormsAuthenticationModule#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.FormsAuthenticationModule/VB/global.asax#1)]
]]></format>
</remarks>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FormsAuthenticationEventArgs (System.Web.HttpContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Web.HttpContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Security.FormsAuthenticationEventArgs.#ctor(System.Web.HttpContext)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (context As HttpContext)" />
<MemberSignature Language="F#" Value="new System.Web.Security.FormsAuthenticationEventArgs : System.Web.HttpContext -> System.Web.Security.FormsAuthenticationEventArgs" Usage="new System.Web.Security.FormsAuthenticationEventArgs context" />
<MemberSignature Language="C++ CLI" Value="public:
 FormsAuthenticationEventArgs(System::Web::HttpContext ^ context);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="context" Type="System.Web.HttpContext" />
</Parameters>
<Docs>
<param name="context">The context for the event.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.Security.FormsAuthenticationEventArgs" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Security.FormsAuthenticationModule> constructs a <xref:System.Web.Security.FormsAuthenticationEventArgs> object using the supplied `context` as the value for the <xref:System.Web.Security.FormsAuthenticationEventArgs.Context%2A> property. It then passes the <xref:System.Web.Security.FormsAuthenticationEventArgs> object to the **FormsAuthentication_OnAuthenticate** event.
]]></format>
</remarks>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
<Member MemberName="Context">
<MemberSignature Language="C#" Value="public System.Web.HttpContext Context { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.HttpContext Context" />
<MemberSignature Language="DocId" Value="P:System.Web.Security.FormsAuthenticationEventArgs.Context" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Context As HttpContext" />
<MemberSignature Language="F#" Value="member this.Context : System.Web.HttpContext" Usage="System.Web.Security.FormsAuthenticationEventArgs.Context" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Web::HttpContext ^ Context { System::Web::HttpContext ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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.Web.HttpContext</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:System.Web.HttpContext" /> object for the current HTTP request.</summary>
<value>The <see cref="T:System.Web.HttpContext" /> object for the current HTTP request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpContext> provides access to <xref:System.Web.HttpContext.Request%2A>, <xref:System.Web.HttpContext.Response%2A>, and <xref:System.Web.HttpContext.User%2A> objects for the current request.
]]></format>
</remarks>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
<Member MemberName="User">
<MemberSignature Language="C#" Value="public System.Security.Principal.IPrincipal User { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Security.Principal.IPrincipal User" />
<MemberSignature Language="DocId" Value="P:System.Web.Security.FormsAuthenticationEventArgs.User" />
<MemberSignature Language="VB.NET" Value="Public Property User As IPrincipal" />
<MemberSignature Language="F#" Value="member this.User : System.Security.Principal.IPrincipal with get, set" Usage="System.Web.Security.FormsAuthenticationEventArgs.User" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Security::Principal::IPrincipal ^ User { System::Security::Principal::IPrincipal ^ get(); void set(System::Security::Principal::IPrincipal ^ value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<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>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Security.Principal.IPrincipal</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see cref="T:System.Security.Principal.IPrincipal" /> object to be associated with the current request.</summary>
<value>The <see cref="T:System.Security.Principal.IPrincipal" /> object to be associated with the current request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Web.Security.FormsAuthenticationEventArgs.User%2A> property to set the <xref:System.Web.HttpContext.User%2A> property of the current <xref:System.Web.HttpContext> to a custom <xref:System.Security.Principal.IPrincipal> object.
If you do not specify a value for the <xref:System.Web.Security.FormsAuthenticationEventArgs.User%2A> property during the **FormsAuthentication_OnAuthenticate** event, the identity supplied by the forms authentication ticket in the cookie or URL is used.
## Examples
The following example uses the **FormsAuthentication_OnAuthenticate** event to set the <xref:System.Web.HttpContext.User%2A> property of the current <xref:System.Web.HttpContext> to a <xref:System.Security.Principal.GenericPrincipal> object with a custom <xref:System.Security.Principal.IPrincipal.Identity%2A>.
[!code-csharp[System.Web.Security.FormsAuthenticationModule#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.FormsAuthenticationModule/CS/global.asax#1)]
[!code-vb[System.Web.Security.FormsAuthenticationModule#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.FormsAuthenticationModule/VB/global.asax#1)]
]]></format>
</remarks>
<related type="Article" href="https://docs.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
</Members>
</Type>