Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,41 @@
"source_path": "aspnetcore/blazor/components/prerendering-and-integration.md",
"redirect_url": "/aspnet/core/blazor/components/integration",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/webassembly/standalone-with-identity.md",
"redirect_url": "/aspnet/core/blazor/security/webassembly/standalone-with-identity/",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/account-confirmation-and-password-recovery.md",
"redirect_url": "/aspnet/core/blazor/security/account-confirmation-and-password-recovery",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/interactive-server-side-rendering.md",
"redirect_url": "/aspnet/core/blazor/security/interactive-server-side-rendering",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/qrcodes-for-authenticator-apps.md",
"redirect_url": "/aspnet/core/blazor/security/qrcodes-for-authenticator-apps",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/static-server-side-rendering.md",
"redirect_url": "/aspnet/core/blazor/security/static-server-side-rendering",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/additional-scenarios.md",
"redirect_url": "/aspnet/core/blazor/security/additional-scenarios",
"redirect_document_id": false
},
{
"source_path": "aspnetcore/blazor/security/server/index.md",
"redirect_url": "/aspnet/core/blazor/security/",
"redirect_document_id": false
}
]
}
4 changes: 2 additions & 2 deletions aspnetcore/blazor/call-web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ builder.Services.AddHttpClient(...)

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

For a demonstration, see <xref:blazor/security/webassembly/standalone-with-identity>.
For a demonstration, see <xref:blazor/security/webassembly/standalone-with-identity/index>.

:::moniker-end

Expand Down Expand Up @@ -901,7 +901,7 @@ For guidance on mitigating overposting attacks, see <xref:tutorials/first-web-ap

### Server-side

* <xref:blazor/security/server/additional-scenarios>: Includes coverage on using <xref:System.Net.Http.HttpClient> to make secure web API requests.
* <xref:blazor/security/additional-scenarios>: Includes coverage on using <xref:System.Net.Http.HttpClient> to make secure web API requests.
* <xref:fundamentals/http-requests>
* <xref:security/enforcing-ssl>
* [Kestrel HTTPS endpoint configuration](xref:fundamentals/servers/kestrel/endpoints)
Expand Down
8 changes: 4 additions & 4 deletions aspnetcore/blazor/components/integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ To resolve the problem, use ***either*** of the following approaches:
* [Authentication and authorization: General aspects](xref:blazor/security/index#aspnet-core-blazor-authentication-and-authorization)
* [Handle Errors: Prerendering](xref:blazor/fundamentals/handle-errors#prerendering)
* [Host and deploy: Blazor Server](xref:blazor/host-and-deploy/server)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)
* <xref:Microsoft.AspNetCore.Components.Routing.Router.OnNavigateAsync> is executed *twice* when prerendering: [Handle asynchronous navigation events with `OnNavigateAsync`](xref:blazor/fundamentals/routing#handle-asynchronous-navigation-events-with-onnavigateasync)

:::moniker-end
Expand Down Expand Up @@ -1076,7 +1076,7 @@ To resolve the problem, use ***either*** of the following approaches:
* [Authentication and authorization: General aspects](xref:blazor/security/index#aspnet-core-blazor-authentication-and-authorization)
* [Handle Errors: Prerendering](xref:blazor/fundamentals/handle-errors#prerendering)
* [Host and deploy: Blazor Server](xref:blazor/host-and-deploy/server)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)

:::moniker-end

Expand Down Expand Up @@ -1508,7 +1508,7 @@ To resolve the problem, use ***either*** of the following approaches:
* [Authentication and authorization: General aspects](xref:blazor/security/index#aspnet-core-blazor-authentication-and-authorization)
* [Handle Errors: Prerendering](xref:blazor/fundamentals/handle-errors#prerendering)
* [Host and deploy: Blazor Server](xref:blazor/host-and-deploy/server)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)

:::moniker-end

Expand Down Expand Up @@ -1938,6 +1938,6 @@ To resolve the problem, use ***either*** of the following approaches:
* [Authentication and authorization: General aspects](xref:blazor/security/index#aspnet-core-blazor-authentication-and-authorization)
* [Handle Errors: Prerendering](xref:blazor/fundamentals/handle-errors#prerendering)
* [Host and deploy: Blazor Server](xref:blazor/host-and-deploy/server)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
* [Threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)

:::moniker-end
4 changes: 2 additions & 2 deletions aspnetcore/blazor/components/prerender.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Prerendering guidance is organized in the Blazor documentation by subject matter
* [Prerendering when integrating components into Razor Pages and MVC apps](xref:blazor/components/integration)

* Authentication and authorization
* [Server-side threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/server/interactive-server-side-rendering#cross-site-scripting-xss)
* [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)
* [Server-side threat mitigation: Cross-site scripting (XSS)](xref:blazor/security/interactive-server-side-rendering#cross-site-scripting-xss)
* [Server-side unauthorized content display while prerendering with a custom `AuthenticationStateProvider`](xref:blazor/security/index#unauthorized-content-display-while-prerendering-with-a-custom-authenticationstateprovider)
* [Blazor WebAssembly rendered component authentication with prerendering](xref:blazor/security/webassembly/additional-scenarios#prerendering-with-authentication)

* [State management: Handle prerendering](xref:blazor/state-management#handle-prerendering): Besides the *Handle prerendering* section, several of the article's other sections include remarks on prerendering.
2 changes: 1 addition & 1 deletion aspnetcore/blazor/components/render-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ To address this scenario, inject the service in a new imports file placed in the

* WebSocket compression
* <xref:blazor/fundamentals/signalr#websocket-compression-for-interactive-server-components>
* <xref:blazor/security/server/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>
* <xref:blazor/security/interactive-server-side-rendering#interactive-server-components-with-websocket-compression-enabled>
* <xref:blazor/js-interop/ssr>
* [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.
* <xref:blazor/components/class-libraries-with-static-ssr>
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/file-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To read data from a user-selected file, call <xref:Microsoft.AspNetCore.Componen

<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.

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:
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:

* 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.
* 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.
Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/blazor/fundamentals/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public static class CircuitServicesServiceCollectionExtensions

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

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>.
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>.

:::moniker-end

Expand Down
16 changes: 16 additions & 0 deletions aspnetcore/blazor/fundamentals/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ Documentation sample apps are available for inspection and download:

Locate a sample app by first selecting the version folder that matches the version of .NET that you're working with.

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

Samples apps in the repository:

* Blazor Web App
* Blazor WebAssembly
* Blazor Web App with EF Core (<xref:blazor/blazor-ef-core>)
* Blazor Web App with SignalR (<xref:blazor/tutorials/signalr-blazor>)
* Two Blazor Web Apps and a Blazor WebAssembly app for calling web (server) APIs (<xref:blazor/call-web-api>)
* Blazor Web App with OIDC (BFF and non-BFF patterns) (<xref:blazor/security/blazor-web-app-oidc>)
* Blazor WebAssembly scopes-enabled logging (<xref:blazor/fundamentals/logging#client-side-log-scopes>)
* Blazor WebAssembly with ASP.NET Core Identity (<xref:blazor/security/webassembly/standalone-with-identity/index>)
* .NET MAUI Blazor Hybrid app with a Blazor Web App and a shared UI provided by a Razor class library (RCL) (<xref:blazor/hybrid/tutorials/maui-blazor-web-app>)

:::moniker-end

:::moniker range="< aspnetcore-8.0"

The sample repo contains two types of samples:
Expand Down
Loading
Loading