Skip to content

Commit d537fa6

Browse files
committed
Updates
1 parent 9fb40da commit d537fa6

33 files changed

+3638
-71
lines changed

.openpublishing.redirection.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,31 @@
13321332
"source_path": "aspnetcore/blazor/security/server/account-confirmation-and-password-recovery.md",
13331333
"redirect_url": "/aspnet/core/blazor/security/account-confirmation-and-password-recovery",
13341334
"redirect_document_id": false
1335+
},
1336+
{
1337+
"source_path": "aspnetcore/blazor/security/server/interactive-server-side-rendering.md",
1338+
"redirect_url": "/aspnet/core/blazor/security/interactive-server-side-rendering",
1339+
"redirect_document_id": false
1340+
},
1341+
{
1342+
"source_path": "aspnetcore/blazor/security/server/qrcodes-for-authenticator-apps.md",
1343+
"redirect_url": "/aspnet/core/blazor/security/qrcodes-for-authenticator-apps",
1344+
"redirect_document_id": false
1345+
},
1346+
{
1347+
"source_path": "aspnetcore/blazor/security/server/static-server-side-rendering.md",
1348+
"redirect_url": "/aspnet/core/blazor/security/static-server-side-rendering",
1349+
"redirect_document_id": false
1350+
},
1351+
{
1352+
"source_path": "aspnetcore/blazor/security/server/additional-scenarios.md",
1353+
"redirect_url": "/aspnet/core/blazor/security/additional-scenarios",
1354+
"redirect_document_id": false
1355+
},
1356+
{
1357+
"source_path": "aspnetcore/blazor/security/server/index.md",
1358+
"redirect_url": "/aspnet/core/blazor/security/",
1359+
"redirect_document_id": false
13351360
}
13361361
]
13371362
}

aspnetcore/blazor/call-web-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ For guidance on mitigating overposting attacks, see <xref:tutorials/first-web-ap
901901

902902
### Server-side
903903

904-
* <xref:blazor/security/server/additional-scenarios>: Includes coverage on using <xref:System.Net.Http.HttpClient> to make secure web API requests.
904+
* <xref:blazor/security/additional-scenarios>: Includes coverage on using <xref:System.Net.Http.HttpClient> to make secure web API requests.
905905
* <xref:fundamentals/http-requests>
906906
* <xref:security/enforcing-ssl>
907907
* [Kestrel HTTPS endpoint configuration](xref:fundamentals/servers/kestrel/endpoints)

aspnetcore/blazor/components/prerender.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Prerendering guidance is organized in the Blazor documentation by subject matter
155155
* [Prerendering when integrating components into Razor Pages and MVC apps](xref:blazor/components/integration)
156156

157157
* Authentication and authorization
158-
* [Server-side threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
158+
* [Server-side threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)
159159
* [Server-side unauthorized content display while prerendering with a custom `AuthenticationStateProvider`](xref:blazor/security/server/index#unauthorized-content-display-while-prerendering-with-a-custom-authenticationstateprovider)
160160
* [Blazor WebAssembly rendered component authentication with prerendering](xref:blazor/security/webassembly/additional-scenarios#prerendering-with-authentication)
161161

aspnetcore/blazor/components/prerendering-and-integration.md

Lines changed: 3065 additions & 0 deletions
Large diffs are not rendered by default.

aspnetcore/blazor/components/render-modes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ To address this scenario, inject the service in a new imports file placed in the
960960

961961
* WebSocket compression
962962
* <xref:blazor/fundamentals/signalr#websocket-compression-for-interactive-server-components>
963-
* <xref:blazor/security/server/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>
963+
* <xref:blazor/security/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>
964964
* <xref:blazor/js-interop/ssr>
965965
* [Cascading values/parameters and render mode boundaries](xref:blazor/components/cascading-values-and-parameters#cascading-valuesparameters-and-render-mode-boundaries): Also see the [Root-level cascading parameters](xref:blazor/components/cascading-values-and-parameters#root-level-cascading-parameters) section earlier in the article.
966966
* <xref:blazor/components/class-libraries-with-static-ssr>

aspnetcore/blazor/file-uploads.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ To read data from a user-selected file, call <xref:Microsoft.AspNetCore.Componen
4949

5050
<xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.OpenReadStream%2A> enforces a maximum size in bytes of its <xref:System.IO.Stream>. Reading one file or multiple files larger than 500 KB results in an exception. This limit prevents developers from accidentally reading large files into memory. The `maxAllowedSize` parameter of <xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.OpenReadStream%2A> can be used to specify a larger size if required.
5151

52-
If you need access to a <xref:System.IO.Stream> that represents the file's bytes, use <xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.OpenReadStream%2A?displayProperty=nameWithType>. Avoid reading the incoming file stream directly into memory all at once. For example, don't copy all of the file's bytes into a <xref:System.IO.MemoryStream> or read the entire stream into a byte array all at once. These approaches can result in degraded app performance and potential [Denial of Service (DoS)](xref:blazor/security/server/interactive-server-side-rendering#denial-of-service-dos-attacks) risk, especially for server-side components. Instead, consider adopting either of the following approaches:
52+
If you need access to a <xref:System.IO.Stream> that represents the file's bytes, use <xref:Microsoft.AspNetCore.Components.Forms.IBrowserFile.OpenReadStream%2A?displayProperty=nameWithType>. Avoid reading the incoming file stream directly into memory all at once. For example, don't copy all of the file's bytes into a <xref:System.IO.MemoryStream> or read the entire stream into a byte array all at once. These approaches can result in degraded app performance and potential [Denial of Service (DoS)](xref:blazor/security/interactive-server-side-rendering#denial-of-service-dos-attacks) risk, especially for server-side components. Instead, consider adopting either of the following approaches:
5353

5454
* Copy the stream directly to a file on disk without reading it into memory. Note that Blazor apps executing code on the server aren't able to access the client's file system directly.
5555
* Upload files from the client directly to an external service. For more information, see the [Upload files to an external service](#upload-files-to-an-external-service) section.

aspnetcore/blazor/fundamentals/dependency-injection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ public static class CircuitServicesServiceCollectionExtensions
612612

613613
Access the circuit-scoped services by injecting the `CircuitServicesAccessor` where it's needed.
614614

615-
For an example that shows how to access the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> from a <xref:System.Net.Http.DelegatingHandler> set up using <xref:System.Net.Http.IHttpClientFactory>, see <xref:blazor/security/server/additional-scenarios#access-authenticationstateprovider-in-outgoing-request-middleware>.
615+
For an example that shows how to access the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> from a <xref:System.Net.Http.DelegatingHandler> set up using <xref:System.Net.Http.IHttpClientFactory>, see <xref:blazor/security/additional-scenarios#access-authenticationstateprovider-in-outgoing-request-middleware>.
616616

617617
:::moniker-end
618618

aspnetcore/blazor/fundamentals/signalr.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Use <xref:Microsoft.AspNetCore.Components.Server.ServerComponentsEndpointOptions
4646

4747
Usage examples:
4848

49-
Disable compression by setting <xref:Microsoft.AspNetCore.Components.Server.ServerComponentsEndpointOptions.DisableWebSocketCompression> to `true`, which reduces the [vulnerability of the app to attack](xref:blazor/security/server/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled) but may result in reduced performance:
49+
Disable compression by setting `ConfigureWebSocketOptions` to `null`, which reduces the [vulnerability of the app to attack](xref:blazor/security/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled) but may result in reduced performance:
5050

5151
```csharp
5252
builder.MapRazorComponents<App>()
@@ -78,7 +78,7 @@ builder.MapRazorComponents<App>()
7878
>
7979
> Additional options include specifying one or more host sources and scheme sources.
8080
81-
For security implications, see <xref:blazor/security/server/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>. For more information on the `frame-ancestors` directive, see [CSP: `frame-ancestors` (MDN documentation)](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors).
81+
For security implications, see <xref:blazor/security/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>. For more information on the `frame-ancestors` directive, see [CSP: `frame-ancestors` (MDN documentation)](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors).
8282

8383
:::moniker-end
8484

@@ -295,7 +295,7 @@ services.AddServerSideBlazor().AddHubOptions(options =>
295295
:::moniker-end
296296

297297
> [!WARNING]
298-
> The default value of <xref:Microsoft.AspNetCore.SignalR.HubOptions.MaximumReceiveMessageSize> is 32 KB. Increasing the value may increase the risk of [Denial of Service (DoS) attacks](xref:blazor/security/server/interactive-server-side-rendering#denial-of-service-dos-attacks).
298+
> The default value of <xref:Microsoft.AspNetCore.SignalR.HubOptions.MaximumReceiveMessageSize> is 32 KB. Increasing the value may increase the risk of [Denial of Service (DoS) attacks](xref:blazor/security/interactive-server-side-rendering#denial-of-service-dos-attacks).
299299
>
300300
> Blazor relies on <xref:Microsoft.AspNetCore.SignalR.HubOptions.MaximumParallelInvocationsPerClient%2A> set to 1, which is the default value. For more information, see [MaximumParallelInvocationsPerClient > 1 breaks file upload in Blazor Server mode (`dotnet/aspnetcore` #53951)](https://github.com/dotnet/aspnetcore/issues/53951).
301301
@@ -408,7 +408,7 @@ builder.Services.AddRazorComponents().AddInteractiveServerComponents()
408408
.AddHubOptions(options => options.MaximumReceiveMessageSize = 64 * 1024);
409409
```
410410

411-
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/server/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
411+
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
412412

413413
A better option for reading large payloads is to send the content in smaller chunks and process the payload as a <xref:System.IO.Stream>. This can be used when reading large JavaScript (JS) interop JSON payloads or if JS interop data is available as raw bytes. For an example that demonstrates sending large binary payloads in server-side apps that uses techniques similar to the [`InputFile` component](xref:blazor/file-uploads), see the [Binary Submit sample app](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/BinarySubmit) and the [Blazor `InputLargeTextArea` Component Sample](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/InputLargeTextArea).
414414

@@ -427,7 +427,7 @@ builder.Services.AddServerSideBlazor()
427427
.AddHubOptions(options => options.MaximumReceiveMessageSize = 64 * 1024);
428428
```
429429

430-
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/server/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
430+
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
431431

432432
A better option for reading large payloads is to send the content in smaller chunks and process the payload as a <xref:System.IO.Stream>. This can be used when reading large JavaScript (JS) interop JSON payloads or if JS interop data is available as raw bytes. For an example that demonstrates sending large binary payloads in Blazor Server that uses techniques similar to the [`InputFile` component](xref:blazor/file-uploads), see the [Binary Submit sample app](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/BinarySubmit) and the [Blazor `InputLargeTextArea` Component Sample](https://github.com/aspnet/samples/tree/main/samples/aspnetcore/blazor/InputLargeTextArea).
433433

@@ -446,7 +446,7 @@ services.AddServerSideBlazor()
446446
.AddHubOptions(options => options.MaximumReceiveMessageSize = 64 * 1024);
447447
```
448448

449-
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/server/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
449+
Increasing the SignalR incoming message size limit comes at the cost of requiring more server resources, and it increases the risk of [Denial of Service (DoS) attacks](xref:blazor/security/interactive-server-side-rendering#denial-of-service-dos-attacks). Additionally, reading a large amount of content in to memory as strings or byte arrays can also result in allocations that work poorly with the garbage collector, resulting in additional performance penalties.
450450

451451
:::moniker-end
452452

@@ -760,7 +760,7 @@ builder.Services.AddIdleCircuitHandler(options =>
760760
Circuit activity handlers also provide an approach for accessing scoped Blazor services from other non-Blazor dependency injection (DI) scopes. For more information and examples, see:
761761

762762
* <xref:blazor/fundamentals/dependency-injection#access-server-side-blazor-services-from-a-different-di-scope>
763-
* <xref:blazor/security/server/additional-scenarios#access-authenticationstateprovider-in-outgoing-request-middleware>
763+
* <xref:blazor/security/additional-scenarios#access-authenticationstateprovider-in-outgoing-request-middleware>
764764

765765
:::moniker-end
766766

@@ -1444,7 +1444,7 @@ When a circuit ends because a user has disconnected and the framework is cleanin
14441444

14451445
## Server-side circuit handler to capture users for custom services
14461446

1447-
Use a <xref:Microsoft.AspNetCore.Components.Server.Circuits.CircuitHandler> to capture a user from the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> and set that user in a service. For more information and example code, see <xref:blazor/security/server/additional-scenarios#circuit-handler-to-capture-users-for-custom-services>.
1447+
Use a <xref:Microsoft.AspNetCore.Components.Server.Circuits.CircuitHandler> to capture a user from the <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> and set that user in a service. For more information and example code, see <xref:blazor/security/additional-scenarios#circuit-handler-to-capture-users-for-custom-services>.
14481448

14491449
:::moniker range=">= aspnetcore-8.0"
14501450

@@ -1466,8 +1466,8 @@ Use a <xref:Microsoft.AspNetCore.Components.Server.Circuits.CircuitHandler> to c
14661466
* Server-side security documentation
14671467
* <xref:blazor/security/index>
14681468
* <xref:blazor/security/server/index>
1469-
* <xref:blazor/security/server/interactive-server-side-rendering>
1470-
* <xref:blazor/security/server/additional-scenarios>
1469+
* <xref:blazor/security/interactive-server-side-rendering>
1470+
* <xref:blazor/security/additional-scenarios>
14711471
* [Server-side reconnection events and component lifecycle events](xref:blazor/components/lifecycle#blazor-server-reconnection-events)
14721472
* [What is Azure SignalR Service?](/azure/azure-signalr/signalr-overview)
14731473
* [Performance guide for Azure SignalR Service](/azure/azure-signalr/signalr-concept-performance)

aspnetcore/blazor/fundamentals/startup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ For examples of JS initializers, see the following resources:
240240
* <xref:blazor/js-interop/ssr>
241241
* <xref:blazor/components/js-spa-frameworks#render-razor-components-from-javascript> (*`quoteContainer2` example*)
242242
* <xref:blazor/components/event-handling#custom-event-arguments> (*Custom clipboard paste event example*)
243-
* <xref:blazor/security/server/qrcodes-for-authenticator-apps>
243+
* <xref:blazor/security/qrcodes-for-authenticator-apps>
244244
* [Basic Test App in the ASP.NET Core GitHub repository (`BasicTestApp.lib.module.js`)](https://github.com/dotnet/aspnetcore/blob/main/src/Components/test/testassets/BasicTestApp/wwwroot/BasicTestApp.lib.module.js)
245245

246246
:::moniker-end

aspnetcore/blazor/host-and-deploy/server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ When considering the scalability of a single server (scale up), the memory avail
3535

3636
For guidance on building secure and scalable server-side Blazor apps, see the following resources:
3737

38-
* <xref:blazor/security/server/static-server-side-rendering>
39-
* <xref:blazor/security/server/interactive-server-side-rendering>
38+
* <xref:blazor/security/static-server-side-rendering>
39+
* <xref:blazor/security/interactive-server-side-rendering>
4040

4141
Each circuit uses approximately 250 KB of memory for a minimal *Hello World*-style app. The size of a circuit depends on the app's code and the state maintenance requirements associated with each component. We recommend that you measure resource demands during development for your app and infrastructure, but the following baseline can be a starting point in planning your deployment target: If you expect your app to support 5,000 concurrent users, consider budgeting at least 1.3 GB of server memory to the app (or ~273 KB per user).
4242

0 commit comments

Comments
 (0)