-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
AuthenticationSection.xml
278 lines (251 loc) · 18.1 KB
/
AuthenticationSection.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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<Type Name="AuthenticationSection" FullName="System.Web.Configuration.AuthenticationSection">
<TypeSignature Language="C#" Value="public sealed class AuthenticationSection : System.Configuration.ConfigurationSection" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed AuthenticationSection extends System.Configuration.ConfigurationSection" />
<TypeSignature Language="DocId" Value="T:System.Web.Configuration.AuthenticationSection" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class AuthenticationSection
Inherits ConfigurationSection" />
<TypeSignature Language="F#" Value="type AuthenticationSection = class
 inherit ConfigurationSection" />
<TypeSignature Language="C++ CLI" Value="public ref class AuthenticationSection sealed : System::Configuration::ConfigurationSection" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Configuration.ConfigurationSection</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Configures the authentication for a Web application. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Configuration.AuthenticationSection> class provides a way to programmatically access and modify the `authentication` section of a configuration file.
> [!NOTE]
> The <xref:System.Web.Configuration.AuthenticationSection> can write information into the related section of the configuration file according to the restrictions defined by the section property <xref:System.Configuration.SectionInformation.AllowDefinition%2A> whose value is <xref:System.Configuration.ConfigurationAllowDefinition.MachineToApplication>. Any attempt to write in a configuration file at a level not allowed in the hierarchy will result in an error message generated by the parser. However, you can use this class to read configuration information at any level in the hierarchy. For safety and scalability, it is recommended that you use an external repository, such as a database, to keep the users' credentials.
## Examples
This section provides two code examples. The first demonstrates how to specify values declaratively for several attributes of the `authentication` section, which can also be accessed as members of the <xref:System.Web.Configuration.AuthenticationSection> class. The second demonstrates how to use the <xref:System.Web.Configuration.AuthenticationSection> class.
The following configuration file example shows how to specify values declaratively for the `authentication` section.
> [!NOTE]
> If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security, it is recommended the use of an external database to store the users' credentials.
```
<authentication mode="Forms">
<forms name="MyAppCookieName" loginUrl="login.aspx">
<credentials passwordFormat="SHA1">
<user name="Kim"
password="07B7F3EE06F278DB966BE960E7CBBD103DF30CA6"/>
<user name="John"
password="BA56E5E0366D003E98EA1C7F04ABF8FCB3753889"/>
</credentials>
</forms>
</authentication>
```
This example uses SHA1. Due to collision problems with SHA1, Microsoft recommends SHA256.
The following code example demonstrates how to use the <xref:System.Web.Configuration.AuthenticationSection> class.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.Configuration.FormsAuthenticationConfiguration" />
<altmember cref="T:System.Web.Configuration.PassportAuthentication" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)">ASP.NET Authentication</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public AuthenticationSection ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Configuration.AuthenticationSection.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 AuthenticationSection();" />
<MemberType>Constructor</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#">[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.Configuration.AuthenticationSection" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.Configuration.AuthenticationSection.%23ctor%2A> constructor is not intended to be used directly from your code. It is called by the ASP.NET configuration system. You obtain an instance of the <xref:System.Web.Configuration.AuthenticationSection> class by using the <xref:System.Configuration.Configuration.GetSection%2A> method.
## Examples
The following code example shows how to obtain a <xref:System.Web.Configuration.AuthenticationSection> object.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet2":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Forms">
<MemberSignature Language="C#" Value="public System.Web.Configuration.FormsAuthenticationConfiguration Forms { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.Configuration.FormsAuthenticationConfiguration Forms" />
<MemberSignature Language="DocId" Value="P:System.Web.Configuration.AuthenticationSection.Forms" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Forms As FormsAuthenticationConfiguration" />
<MemberSignature Language="F#" Value="member this.Forms : System.Web.Configuration.FormsAuthenticationConfiguration" Usage="System.Web.Configuration.AuthenticationSection.Forms" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Web::Configuration::FormsAuthenticationConfiguration ^ Forms { System::Web::Configuration::FormsAuthenticationConfiguration ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Configuration.ConfigurationProperty("forms")]</AttributeName>
<AttributeName Language="F#">[<System.Configuration.ConfigurationProperty("forms")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.Configuration.FormsAuthenticationConfiguration</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="P:System.Web.Configuration.AuthenticationSection.Forms" /> element property.</summary>
<value>A <see cref="P:System.Web.Configuration.AuthenticationSection.Forms" /> element property that contains information used during forms-based authentication.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to use the <xref:System.Web.Configuration.AuthenticationSection.Forms%2A> element property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet5":::
]]></format>
</remarks>
<altmember cref="P:System.Web.Configuration.AuthenticationSection.Forms" />
</Docs>
</Member>
<Member MemberName="Mode">
<MemberSignature Language="C#" Value="public System.Web.Configuration.AuthenticationMode Mode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.Configuration.AuthenticationMode Mode" />
<MemberSignature Language="DocId" Value="P:System.Web.Configuration.AuthenticationSection.Mode" />
<MemberSignature Language="VB.NET" Value="Public Property Mode As AuthenticationMode" />
<MemberSignature Language="F#" Value="member this.Mode : System.Web.Configuration.AuthenticationMode with get, set" Usage="System.Web.Configuration.AuthenticationSection.Mode" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Web::Configuration::AuthenticationMode Mode { System::Web::Configuration::AuthenticationMode get(); void set(System::Web::Configuration::AuthenticationMode value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.Configuration.AuthenticationMode.Windows)]</AttributeName>
<AttributeName Language="F#">[<System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.Configuration.AuthenticationMode.Windows)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.Configuration.AuthenticationMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the authentication modality.</summary>
<value>One of the <see cref="T:System.Web.Configuration.AuthenticationMode" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to use the <xref:System.Web.Configuration.AuthenticationSection.Mode%2A> property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet4":::
]]></format>
</remarks>
<altmember cref="T:System.Web.Configuration.AuthenticationMode" />
</Docs>
</Member>
<Member MemberName="Passport">
<MemberSignature Language="C#" Value="public System.Web.Configuration.PassportAuthentication Passport { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.Configuration.PassportAuthentication Passport" />
<MemberSignature Language="DocId" Value="P:System.Web.Configuration.AuthenticationSection.Passport" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Passport As PassportAuthentication" />
<MemberSignature Language="F#" Value="member this.Passport : System.Web.Configuration.PassportAuthentication" Usage="System.Web.Configuration.AuthenticationSection.Passport" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Web::Configuration::PassportAuthentication ^ Passport { System::Web::Configuration::PassportAuthentication ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.Configuration.ConfigurationProperty("passport")]</AttributeName>
<AttributeName Language="F#">[<System.Configuration.ConfigurationProperty("passport")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Obsolete("This property is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]</AttributeName>
<AttributeName Language="F#">[<System.Obsolete("This property is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.Configuration.PassportAuthentication</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the <see cref="P:System.Web.Configuration.AuthenticationSection.Passport" /> element property.</summary>
<value>A <see cref="P:System.Web.Configuration.AuthenticationSection.Passport" /> element property that contains information used during passport-based authentication.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to use the <xref:System.Web.Configuration.AuthenticationSection.Passport%2A> element property.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/CS/authenticationsection.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Configuration.AuthenticationSection/VB/authenticationsection.vb" id="Snippet3":::
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Properties">
<MemberSignature Language="C#" Value="protected override System.Configuration.ConfigurationPropertyCollection Properties { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Configuration.ConfigurationPropertyCollection Properties" />
<MemberSignature Language="DocId" Value="P:System.Web.Configuration.AuthenticationSection.Properties" />
<MemberSignature Language="VB.NET" Value="Protected Overrides ReadOnly Property Properties As ConfigurationPropertyCollection" />
<MemberSignature Language="F#" Value="member this.Properties : System.Configuration.ConfigurationPropertyCollection" Usage="System.Web.Configuration.AuthenticationSection.Properties" />
<MemberSignature Language="C++ CLI" Value="protected:
 virtual property System::Configuration::ConfigurationPropertyCollection ^ Properties { System::Configuration::ConfigurationPropertyCollection ^ 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.Configuration.ConfigurationPropertyCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Reset">
<MemberSignature Language="C#" Value="protected override void Reset (System.Configuration.ConfigurationElement parentElement);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Reset(class System.Configuration.ConfigurationElement parentElement) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.Configuration.AuthenticationSection.Reset(System.Configuration.ConfigurationElement)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Reset (parentElement As ConfigurationElement)" />
<MemberSignature Language="F#" Value="override this.Reset : System.Configuration.ConfigurationElement -> unit" Usage="authenticationSection.Reset parentElement" />
<MemberSignature Language="C++ CLI" Value="protected:
 override void Reset(System::Configuration::ConfigurationElement ^ parentElement);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="parentElement" Type="System.Configuration.ConfigurationElement" />
</Parameters>
<Docs>
<param name="parentElement">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>