();
Client.Program.ConfigureCommonServices(services);
```
-In the server app's `Program.cs`, replace [`app.MapFallbackToFile("index.html")`](xref:Microsoft.AspNetCore.Builder.StaticFilesEndpointRouteBuilderExtensions.MapFallbackToFile%2A) with [`app.MapFallbackToPage("/_Host")`](xref:Microsoft.AspNetCore.Builder.RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage%2A):
+In the **`Server`** app's `Program.cs` file, replace [`app.MapFallbackToFile("index.html")`](xref:Microsoft.AspNetCore.Builder.StaticFilesEndpointRouteBuilderExtensions.MapFallbackToFile%2A) with [`app.MapFallbackToPage("/_Host")`](xref:Microsoft.AspNetCore.Builder.RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage%2A):
```csharp
app.MapControllers();
app.MapFallbackToPage("/_Host");
```
-In the server app, create a `Pages` folder if it doesn't exist. Create a `_Host.cshtml` page inside the server app's `Pages` folder. Paste the contents from the client app's `wwwroot/index.html` file into the `Pages/_Host.cshtml` file. Update the file's contents:
+In the **`Server`** app, create a `Pages` folder if it doesn't exist. Create a `_Host.cshtml` page inside the **`Server`** app's `Pages` folder. Paste the contents from the client app's `wwwroot/index.html` file into the `Pages/_Host.cshtml` file. Update the file's contents:
* Add `@page "_Host"` to the top of the file.
* Replace the `Loading...
` tag with the following:
```cshtml
- @if (!HttpContext.Request.Path.StartsWithSegments("/authentication"))
- {
-
- }
- else
+ @if (HttpContext.Request.Path.StartsWithSegments("/authentication"))
{
Loading...
}
+ else
+ {
+
+ }
```
-
+
In the preceding example, the placeholder `{CLIENT APP ASSEMBLY NAME}` is the client app's assembly name (for example `BlazorSample.Client`).
## Options for hosted apps and third-party login providers
@@ -1908,18 +1908,18 @@ In the server app, create a `Pages` folder if it doesn't exist. Create a `_Host.
```cshtml
- @if (!HttpContext.Request.Path.StartsWithSegments("/authentication"))
- {
-
- }
- else
+ @if (HttpContext.Request.Path.StartsWithSegments("/authentication"))
{
Loading...
}
+ else
+ {
+
+ }
```
-
+
In the preceding example, the placeholder `{CLIENT APP ASSEMBLY NAME}` is the client app's assembly name (for example `BlazorSample.Client`).
## Options for hosted apps and third-party login providers
@@ -2949,18 +2949,18 @@ In the server app, create a `Pages` folder if it doesn't exist. Create a `_Host.
```cshtml
- @if (!HttpContext.Request.Path.StartsWithSegments("/authentication"))
- {
-
- }
- else
+ @if (HttpContext.Request.Path.StartsWithSegments("/authentication"))
{
Loading...
}
+ else
+ {
+
+ }
```
-
+
In the preceding example, the placeholder `{CLIENT APP ASSEMBLY NAME}` is the client app's assembly name (for example `BlazorSample.Client`).
## Options for hosted apps and third-party login providers
diff --git a/aspnetcore/blazor/security/webassembly/index.md b/aspnetcore/blazor/security/webassembly/index.md
index a79b227d27..bc72570bf0 100644
--- a/aspnetcore/blazor/security/webassembly/index.md
+++ b/aspnetcore/blazor/security/webassembly/index.md
@@ -34,6 +34,9 @@ Other options for authenticating SPAs exist, such as the use of SameSite cookies
* Tokens with OAuth and OIDC don't rely on the user agent behaving correctly to ensure that the app is secure.
* Token-based protocols, such as OAuth and OIDC, allow for authenticating and authorizing hosted and standalone apps with the same set of security characteristics.
+> [!IMPORTANT]
+> [Prerendering](xref:blazor/components/prerendering-and-integration) isn't supported for authentication endpoints (`/authentication/` path segment). For more information, see .
+
## Authentication process with OIDC
The [`Microsoft.AspNetCore.Components.WebAssembly.Authentication`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebAssembly.Authentication) library offers several primitives to implement authentication and authorization using OIDC. In broad terms, authentication works as follows: