Skip to content

Commit e4be680

Browse files
authored
Merge pull request #36474 from dotnet/main
Merge to Live
2 parents 7347d00 + ea03707 commit e4be680

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

aspnetcore/blazor/security/account-confirmation-and-password-recovery.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ We strongly recommend that you avoid storing secrets in project code or configur
5656

5757
### Secret Manager tool
5858

59-
If the project has already been initialized for the [Secret Manager tool](xref:security/app-secrets), it will already have an app secrets identifier (`<AppSecretsId>`) in its project file (`.csproj`). In Visual Studio, you can tell if the app secrets ID is present by looking at the **Properties** panel when the project is selected in **Solution Explorer**. If the app hasn't been initialized, execute the following command in a command shell opened to the project's directory. In Visual Studio, you can use the Developer PowerShell command prompt.
59+
If the project has already been initialized for the [Secret Manager tool](xref:security/app-secrets), it will already have a user secrets identifier (`<UserSecretsId>`) in its project file (`.csproj`). In Visual Studio, you can tell if the user secrets ID is present by looking at the **Properties** panel when the project is selected in **Solution Explorer**. If the app hasn't been initialized, execute the following command in a command shell opened to the project's directory. In Visual Studio, you can use the Developer PowerShell command prompt.
6060

6161
```dotnetcli
6262
dotnet user-secrets init
@@ -186,17 +186,17 @@ public class EmailSender(IOptions<AuthMessageSenderOptions> optionsAccessor,
186186
187187
public AuthMessageSenderOptions Options { get; } = optionsAccessor.Value;
188188
189-
public Task SendConfirmationLinkAsync(AppUser user, string email,
189+
public Task SendConfirmationLinkAsync(ApplicationUser user, string email,
190190
string confirmationLink) => SendEmailAsync(email, "Confirm your email",
191191
"<html lang=\"en\"><head></head><body>Please confirm your account by " +
192192
$"<a href='{confirmationLink}'>clicking here</a>.</body></html>");
193193
194-
public Task SendPasswordResetLinkAsync(AppUser user, string email,
194+
public Task SendPasswordResetLinkAsync(ApplicationUser user, string email,
195195
string resetLink) => SendEmailAsync(email, "Reset your password",
196196
"<html lang=\"en\"><head></head><body>Please reset your password by " +
197197
$"<a href='{resetLink}'>clicking here</a>.</body></html>");
198198
199-
public Task SendPasswordResetCodeAsync(AppUser user, string email,
199+
public Task SendPasswordResetCodeAsync(ApplicationUser user, string email,
200200
string resetCode) => SendEmailAsync(email, "Reset your password",
201201
"<html lang=\"en\"><head></head><body>Please reset your password " +
202202
$"using the following code:<br>{resetCode}</body></html>");

aspnetcore/blazor/security/webassembly/standalone-with-identity/account-confirmation-and-password-recovery.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ We strongly recommend that you avoid storing secrets in project code or configur
6363

6464
## Secret Manager Tool
6565

66-
If the server project has already been initialized for the [Secret Manager tool](xref:security/app-secrets), it will already have a app secrets identifier (`<AppSecretsId>`) in its project file (`.csproj`). In Visual Studio, you can tell if the app secrets ID is present by looking at the **Properties** panel when the project is selected in **Solution Explorer**. If the app hasn't been initialized, execute the following command in a command shell opened to the server project's directory. In Visual Studio, you can use the Developer PowerShell command prompt (use the `cd` command to change the directory to the server project after you open the command shell).
66+
If the server project has already been initialized for the [Secret Manager tool](xref:security/app-secrets), it will already have a user secrets identifier (`<UserSecretsId>`) in its project file (`.csproj`). In Visual Studio, you can tell if the user secrets ID is present by looking at the **Properties** panel when the project is selected in **Solution Explorer**. If the app hasn't been initialized, execute the following command in a command shell opened to the server project's directory. In Visual Studio, you can use the Developer PowerShell command prompt (use the `cd` command to change the directory to the server project after you open the command shell).
6767

6868
```dotnetcli
6969
dotnet user-secrets init

aspnetcore/security/anti-request-forgery.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,14 @@ The antiforgery middleware:
295295
The antiforgery token is only validated if:
296296

297297
* The endpoint contains metadata implementing <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryMetadata> where `RequiresValidation=true`.
298-
* The HTTP method associated with the endpoint is a relevant [HTTP method](https://developer.mozilla.org/docs/Web/HTTP/Methods). The relevant methods are all [HTTP methods](https://developer.mozilla.org/docs/Web/HTTP/Methods) except for TRACE, OPTIONS, HEAD, and GET.
298+
* The HTTP method associated with the endpoint is a relevant [HTTP method](https://developer.mozilla.org/docs/Web/HTTP/Methods) of type POST, PUT, or PATCH.
299299
* The request is associated with a valid endpoint.
300300

301+
Antiforgery Middleware doesn't short-circuit the request pipeline. Endpoint code always runs, even if token validation fails. To observe the outcome of the token validation, resolve the <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryValidationFeature> from <xref:Microsoft.AspNetCore.Http.HttpContext.Features%2A?displayProperty=nameWithType> and inspect its <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryValidationFeature.IsValid%2A> property or the <xref:Microsoft.AspNetCore.Antiforgery.IAntiforgeryValidationFeature.Error%2A> property for failure details. This approach is useful when endpoints require custom handling for failed antiforgery validation.
302+
301303
***Note:*** When enabled manually, the antiforgery middleware must run after the authentication and authorization middleware to prevent reading form data when the user is unauthenticated.
302304

303-
By default, Minimal APIs that accept form data require antiforgery token validation.
305+
By default, Minimal APIs that accept form data require antiforgery token validation and fail before running application code if antiforgery validation isn't successful.
304306

305307
Consider the following `GenerateForm` method:
306308

0 commit comments

Comments
 (0)