-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
FormsAuthenticationModule.xml
201 lines (176 loc) · 13.7 KB
/
FormsAuthenticationModule.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
<Type Name="FormsAuthenticationModule" FullName="System.Web.Security.FormsAuthenticationModule">
<TypeSignature Language="C#" Value="public sealed class FormsAuthenticationModule : System.Web.IHttpModule" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit FormsAuthenticationModule extends System.Object implements class System.Web.IHttpModule" />
<TypeSignature Language="DocId" Value="T:System.Web.Security.FormsAuthenticationModule" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class FormsAuthenticationModule
Implements IHttpModule" />
<TypeSignature Language="F#" Value="type FormsAuthenticationModule = class
 interface IHttpModule" />
<TypeSignature Language="C++ CLI" Value="public ref class FormsAuthenticationModule sealed : System::Web::IHttpModule" />
<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.Object</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Web.IHttpModule</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>Sets the identity of the user for an ASP.NET application when forms authentication is enabled. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Security.FormsAuthenticationModule> sets the current <xref:System.Web.HttpContext.User%2A?displayProperty=nameWithType> property to an <xref:System.Security.Principal.IPrincipal> object that represents the user identity for the current request when the authentication <xref:System.Web.Configuration.AuthenticationSection.Mode%2A> is set to <xref:System.Web.Configuration.AuthenticationMode.Forms> in the [authentication Element (ASP.NET Settings Schema)](https://msdn.microsoft.com/library/27bc0ba9-f23a-45f3-ae42-dbe7916e3ee2) element of the application's configuration file.
The <xref:System.Web.Security.FormsAuthenticationModule> exposes an <xref:System.Web.Security.FormsAuthenticationModule.Authenticate> event that enables you to provide a custom <xref:System.Security.Principal.IPrincipal> object for the <xref:System.Web.HttpContext.User%2A> property of the current <xref:System.Web.HttpContext>. The <xref:System.Web.Security.FormsAuthenticationModule.Authenticate> event is accessed by specifying a subroutine named **FormsAuthentication_OnAuthenticate** in the Global.asax file for your ASP.NET application.
> [!NOTE]
> In IIS 7.0, using the <xref:System.Web.Security.WindowsAuthenticationModule> with the <xref:System.Web.Security.FormsAuthenticationModule> is not supported. For more information about compatibility issues in Integrated modes, see [Moving an ASP.NET Application from IIS 6.0 to IIS 7.0](https://msdn.microsoft.com/library/76f9cc78-f978-4837-b1c8-51d642ec4847).
## 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 custom <xref:System.Security.Principal.IPrincipal> object.
[!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://learn.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FormsAuthenticationModule ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Security.FormsAuthenticationModule.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 FormsAuthenticationModule();" />
<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 />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.Security.FormsAuthenticationModule" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is not intended to be called from application code.
ASP.NET calls this constructor to create an instance of the <xref:System.Web.Security.FormsAuthenticationModule> class. After calling the constructor, it calls the <xref:System.Web.Security.FormsAuthenticationModule.Init%2A> method to initialize the new <xref:System.Web.Security.FormsAuthenticationModule> object.
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
<Member MemberName="Authenticate">
<MemberSignature Language="C#" Value="public event System.Web.Security.FormsAuthenticationEventHandler Authenticate;" />
<MemberSignature Language="ILAsm" Value=".event class System.Web.Security.FormsAuthenticationEventHandler Authenticate" />
<MemberSignature Language="DocId" Value="E:System.Web.Security.FormsAuthenticationModule.Authenticate" />
<MemberSignature Language="VB.NET" Value="Public Custom Event Authenticate As FormsAuthenticationEventHandler " />
<MemberSignature Language="F#" Value="member this.Authenticate : System.Web.Security.FormsAuthenticationEventHandler " Usage="member this.Authenticate : System.Web.Security.FormsAuthenticationEventHandler " />
<MemberSignature Language="C++ CLI" Value="public:
 event System::Web::Security::FormsAuthenticationEventHandler ^ Authenticate;" />
<MemberType>Event</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>
<ReturnValue>
<ReturnType>System.Web.Security.FormsAuthenticationEventHandler</ReturnType>
</ReturnValue>
<Docs>
<summary>Occurs when the application authenticates the current request.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Security.FormsAuthenticationModule.Authenticate> event is raised during the <xref:System.Web.HttpApplication.AuthenticateRequest> event.
You can handle the <xref:System.Web.Security.FormsAuthenticationModule.Authenticate> event of the <xref:System.Web.Security.FormsAuthenticationModule> class by specifying a subroutine named **FormsAuthentication_OnAuthenticate** in the Global.asax file for your ASP.NET application.
You can use the <xref:System.Web.Security.FormsAuthenticationEventArgs><xref:System.Web.Security.FormsAuthenticationEventArgs.User%2A> property supplied to the **FormsAuthentication_OnAuthenticate** event 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 mode is set to <xref:System.Web.Configuration.AuthenticationMode.Forms> in the [authentication Element (ASP.NET Settings Schema)](https://msdn.microsoft.com/library/27bc0ba9-f23a-45f3-ae42-dbe7916e3ee2) element of the application's configuration file 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 that has 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://learn.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
<Member MemberName="Dispose">
<MemberSignature Language="C#" Value="public void Dispose ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Dispose() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Security.FormsAuthenticationModule.Dispose" />
<MemberSignature Language="VB.NET" Value="Public Sub Dispose ()" />
<MemberSignature Language="F#" Value="abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit" Usage="formsAuthenticationModule.Dispose " />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Dispose();" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.IHttpModule.Dispose</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Releases all resources, other than memory, used by the <see cref="T:System.Web.Security.FormsAuthenticationModule" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is not intended to be called from application code.
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
<Member MemberName="Init">
<MemberSignature Language="C#" Value="public void Init (System.Web.HttpApplication app);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Init(class System.Web.HttpApplication app) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Security.FormsAuthenticationModule.Init(System.Web.HttpApplication)" />
<MemberSignature Language="VB.NET" Value="Public Sub Init (app As HttpApplication)" />
<MemberSignature Language="F#" Value="abstract member Init : System.Web.HttpApplication -> unit
override this.Init : System.Web.HttpApplication -> unit" Usage="formsAuthenticationModule.Init app" />
<MemberSignature Language="C++ CLI" Value="public:
 virtual void Init(System::Web::HttpApplication ^ app);" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.IHttpModule.Init(System.Web.HttpApplication)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="app" Type="System.Web.HttpApplication" />
</Parameters>
<Docs>
<param name="app">The current <see cref="T:System.Web.HttpApplication" /> instance.</param>
<summary>Initializes the <see cref="T:System.Web.Security.FormsAuthenticationModule" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is not intended to be called from application code.
The <xref:System.Web.Security.FormsAuthenticationModule.Init%2A> method ensures that the <xref:System.Web.Security.FormsAuthenticationModule> is included in the processing of the <xref:System.Web.HttpApplication.AuthenticateRequest> and <xref:System.Web.HttpApplication.EndRequest> events.
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/9wff0kyh(v=vs.100)">Forms Authentication Provider</related>
</Docs>
</Member>
</Members>
</Type>