@@ -14,15 +14,16 @@ namespace Microsoft.AspNetCore.Authentication
1414 public static class AuthenticationHttpContextExtensions
1515 {
1616 /// <summary>
17- /// Extension method for authenticate using the <see cref="AuthenticationOptions.DefaultAuthenticateScheme"/> scheme.
17+ /// Authenticate the current request using the default authentication scheme.
18+ /// The default authentication scheme can be configured using <see cref="AuthenticationOptions.DefaultAuthenticateScheme"/>.
1819 /// </summary>
1920 /// <param name="context">The <see cref="HttpContext"/> context.</param>
2021 /// <returns>The <see cref="AuthenticateResult"/>.</returns>
2122 public static Task < AuthenticateResult > AuthenticateAsync ( this HttpContext context ) =>
2223 context . AuthenticateAsync ( scheme : null ) ;
2324
2425 /// <summary>
25- /// Extension method for authenticate .
26+ /// Authenticate the current request using the specified scheme .
2627 /// </summary>
2728 /// <param name="context">The <see cref="HttpContext"/> context.</param>
2829 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -31,7 +32,8 @@ public static Task<AuthenticateResult> AuthenticateAsync(this HttpContext contex
3132 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . AuthenticateAsync ( context , scheme ) ;
3233
3334 /// <summary>
34- /// Extension method for Challenge.
35+ /// Challenge the current request using the specified scheme.
36+ /// An authentication challenge can be issued when an unauthenticated user requests an endpoint that requires authentication.
3537 /// </summary>
3638 /// <param name="context">The <see cref="HttpContext"/> context.</param>
3739 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -40,15 +42,19 @@ public static Task ChallengeAsync(this HttpContext context, string? scheme) =>
4042 context . ChallengeAsync ( scheme , properties : null ) ;
4143
4244 /// <summary>
43- /// Extension method for authenticate using the <see cref="AuthenticationOptions.DefaultChallengeScheme"/> scheme.
45+ /// Challenge the current request using the default challenge scheme.
46+ /// An authentication challenge can be issued when an unauthenticated user requests an endpoint that requires authentication.
47+ /// The default challenge scheme can be configured using <see cref="AuthenticationOptions.DefaultChallengeScheme"/>.
4448 /// </summary>
4549 /// <param name="context">The <see cref="HttpContext"/> context.</param>
4650 /// <returns>The task.</returns>
4751 public static Task ChallengeAsync ( this HttpContext context ) =>
4852 context . ChallengeAsync ( scheme : null , properties : null ) ;
4953
5054 /// <summary>
51- /// Extension method for authenticate using the <see cref="AuthenticationOptions.DefaultChallengeScheme"/> scheme.
55+ /// Challenge the current request using the default challenge scheme.
56+ /// An authentication challenge can be issued when an unauthenticated user requests an endpoint that requires authentication.
57+ /// The default challenge scheme can be configured using <see cref="AuthenticationOptions.DefaultChallengeScheme"/>.
5258 /// </summary>
5359 /// <param name="context">The <see cref="HttpContext"/> context.</param>
5460 /// <param name="properties">The <see cref="AuthenticationProperties"/> properties.</param>
@@ -57,7 +63,8 @@ public static Task ChallengeAsync(this HttpContext context, AuthenticationProper
5763 context . ChallengeAsync ( scheme : null , properties : properties ) ;
5864
5965 /// <summary>
60- /// Extension method for Challenge.
66+ /// Challenge the current request using the specified scheme.
67+ /// An authentication challenge can be issued when an unauthenticated user requests an endpoint that requires authentication.
6168 /// </summary>
6269 /// <param name="context">The <see cref="HttpContext"/> context.</param>
6370 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -67,7 +74,8 @@ public static Task ChallengeAsync(this HttpContext context, string? scheme, Auth
6774 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . ChallengeAsync ( context , scheme , properties ) ;
6875
6976 /// <summary>
70- /// Extension method for Forbid.
77+ /// Forbid the current request using the specified scheme.
78+ /// Forbid is used when an authenticated user attempts to access a resource they are not permitted to access.
7179 /// </summary>
7280 /// <param name="context">The <see cref="HttpContext"/> context.</param>
7381 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -76,15 +84,19 @@ public static Task ForbidAsync(this HttpContext context, string? scheme) =>
7684 context . ForbidAsync ( scheme , properties : null ) ;
7785
7886 /// <summary>
79- /// Extension method for Forbid using the <see cref="AuthenticationOptions.DefaultForbidScheme"/> scheme..
87+ /// Forbid the current request using the default forbid scheme.
88+ /// Forbid is used when an authenticated user attempts to access a resource they are not permitted to access.
89+ /// The default forbid scheme can be configured using <see cref="AuthenticationOptions.DefaultForbidScheme"/>.
8090 /// </summary>
8191 /// <param name="context">The <see cref="HttpContext"/> context.</param>
8292 /// <returns>The task.</returns>
8393 public static Task ForbidAsync ( this HttpContext context ) =>
8494 context . ForbidAsync ( scheme : null , properties : null ) ;
8595
8696 /// <summary>
87- /// Extension method for Forbid.
97+ /// Forbid the current request using the default forbid scheme.
98+ /// Forbid is used when an authenticated user attempts to access a resource they are not permitted to access.
99+ /// The default forbid scheme can be configured using <see cref="AuthenticationOptions.DefaultForbidScheme"/>.
88100 /// </summary>
89101 /// <param name="context">The <see cref="HttpContext"/> context.</param>
90102 /// <param name="properties">The <see cref="AuthenticationProperties"/> properties.</param>
@@ -93,7 +105,8 @@ public static Task ForbidAsync(this HttpContext context, AuthenticationPropertie
93105 context . ForbidAsync ( scheme : null , properties : properties ) ;
94106
95107 /// <summary>
96- /// Extension method for Forbid.
108+ /// Forbid the current request using the specified scheme.
109+ /// Forbid is used when an authenticated user attempts to access a resource they are not permitted to access.
97110 /// </summary>
98111 /// <param name="context">The <see cref="HttpContext"/> context.</param>
99112 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -103,7 +116,7 @@ public static Task ForbidAsync(this HttpContext context, string? scheme, Authent
103116 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . ForbidAsync ( context , scheme , properties ) ;
104117
105118 /// <summary>
106- /// Extension method for SignIn .
119+ /// Sign in a principal for the specified scheme .
107120 /// </summary>
108121 /// <param name="context">The <see cref="HttpContext"/> context.</param>
109122 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -113,7 +126,8 @@ public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsP
113126 context . SignInAsync ( scheme , principal , properties : null ) ;
114127
115128 /// <summary>
116- /// Extension method for SignIn using the <see cref="AuthenticationOptions.DefaultSignInScheme"/>.
129+ /// Sign in a principal for the default authentication scheme.
130+ /// The default scheme for signing in can be configured using <see cref="AuthenticationOptions.DefaultSignInScheme"/>.
117131 /// </summary>
118132 /// <param name="context">The <see cref="HttpContext"/> context.</param>
119133 /// <param name="principal">The user.</param>
@@ -122,7 +136,8 @@ public static Task SignInAsync(this HttpContext context, ClaimsPrincipal princip
122136 context . SignInAsync ( scheme : null , principal : principal , properties : null ) ;
123137
124138 /// <summary>
125- /// Extension method for SignIn using the <see cref="AuthenticationOptions.DefaultSignInScheme"/>.
139+ /// Sign in a principal for the default authentication scheme.
140+ /// The default scheme for signing in can be configured using <see cref="AuthenticationOptions.DefaultForbidScheme"/>.
126141 /// </summary>
127142 /// <param name="context">The <see cref="HttpContext"/> context.</param>
128143 /// <param name="principal">The user.</param>
@@ -132,7 +147,7 @@ public static Task SignInAsync(this HttpContext context, ClaimsPrincipal princip
132147 context . SignInAsync ( scheme : null , principal : principal , properties : properties ) ;
133148
134149 /// <summary>
135- /// Extension method for SignIn .
150+ /// Sign in a principal for the specified scheme .
136151 /// </summary>
137152 /// <param name="context">The <see cref="HttpContext"/> context.</param>
138153 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -143,30 +158,32 @@ public static Task SignInAsync(this HttpContext context, string? scheme, ClaimsP
143158 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . SignInAsync ( context , scheme , principal , properties ) ;
144159
145160 /// <summary>
146- /// Extension method for SignOut using the <see cref="AuthenticationOptions.DefaultSignOutScheme"/>.
161+ /// Sign out a principal for the default authentication scheme.
162+ /// The default scheme for signing out can be configured using <see cref="AuthenticationOptions.DefaultSignOutScheme"/>.
147163 /// </summary>
148164 /// <param name="context">The <see cref="HttpContext"/> context.</param>
149165 /// <returns>The task.</returns>
150166 public static Task SignOutAsync ( this HttpContext context ) => context . SignOutAsync ( scheme : null , properties : null ) ;
151167
152168 /// <summary>
153- /// Extension method for SignOut using the <see cref="AuthenticationOptions.DefaultSignOutScheme"/>.
169+ /// Sign out a principal for the default authentication scheme.
170+ /// The default scheme for signing out can be configured using <see cref="AuthenticationOptions.DefaultSignOutScheme"/>.
154171 /// </summary>
155172 /// <param name="context">The <see cref="HttpContext"/> context.</param>
156173 /// <param name="properties">The <see cref="AuthenticationProperties"/> properties.</param>
157174 /// <returns>The task.</returns>
158175 public static Task SignOutAsync ( this HttpContext context , AuthenticationProperties ? properties ) => context . SignOutAsync ( scheme : null , properties : properties ) ;
159176
160177 /// <summary>
161- /// Extension method for SignOut .
178+ /// Sign out a principal for the specified scheme .
162179 /// </summary>
163180 /// <param name="context">The <see cref="HttpContext"/> context.</param>
164181 /// <param name="scheme">The name of the authentication scheme.</param>
165182 /// <returns>The task.</returns>
166183 public static Task SignOutAsync ( this HttpContext context , string ? scheme ) => context . SignOutAsync ( scheme , properties : null ) ;
167184
168185 /// <summary>
169- /// Extension method for SignOut .
186+ /// Sign out a principal for the specified scheme .
170187 /// </summary>
171188 /// <param name="context">The <see cref="HttpContext"/> context.</param>
172189 /// <param name="scheme">The name of the authentication scheme.</param>
@@ -176,21 +193,22 @@ public static Task SignOutAsync(this HttpContext context, string? scheme, Authen
176193 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . SignOutAsync ( context , scheme , properties ) ;
177194
178195 /// <summary>
179- /// Extension method for getting the value of an authentication token.
196+ /// Authenticates the request using the specified scheme and returns the value for the token.
180197 /// </summary>
181198 /// <param name="context">The <see cref="HttpContext"/> context.</param>
182199 /// <param name="scheme">The name of the authentication scheme.</param>
183200 /// <param name="tokenName">The name of the token.</param>
184- /// <returns>The value of the token.</returns>
201+ /// <returns>The value of the token if present .</returns>
185202 public static Task < string ? > GetTokenAsync ( this HttpContext context , string ? scheme , string tokenName ) =>
186203 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . GetTokenAsync ( context , scheme , tokenName ) ;
187204
188205 /// <summary>
189- /// Extension method for getting the value of an authentication token.
206+ /// Authenticates the request using the default authentication scheme and returns the value for the token.
207+ /// The default authentication scheme can be configured using <see cref="AuthenticationOptions.DefaultAuthenticateScheme"/>.
190208 /// </summary>
191209 /// <param name="context">The <see cref="HttpContext"/> context.</param>
192210 /// <param name="tokenName">The name of the token.</param>
193- /// <returns>The value of the token.</returns>
211+ /// <returns>The value of the token if present .</returns>
194212 public static Task < string ? > GetTokenAsync ( this HttpContext context , string tokenName ) =>
195213 context . RequestServices . GetRequiredService < IAuthenticationService > ( ) . GetTokenAsync ( context , tokenName ) ;
196214 }
0 commit comments