Change placeholder (#28435)

pull/28436/head
Luke Latham 2023-02-17 05:25:57 -05:00 committed by GitHub
parent 993d573bdd
commit 15edddaedc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 75 additions and 75 deletions

View File

@ -299,7 +299,7 @@ After [configuring the solution](#solution-configuration), including the [additi
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssembly>
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssemblyPrerendered>
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{APP ASSEMBLY}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{ASSEMBLY NAME}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the **:::no-loc text="Server":::** project, `Pages/RazorPagesCounter1.cshtml`:
@ -1221,7 +1221,7 @@ After [configuring the solution](#solution-configuration), including the [additi
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssembly>
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssemblyPrerendered>
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{APP ASSEMBLY}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{ASSEMBLY NAME}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the **:::no-loc text="Server":::** project, `Pages/RazorPagesCounter1.cshtml`:
@ -2035,7 +2035,7 @@ After [configuring the solution](#solution-configuration), including the [additi
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssembly>
* <xref:Microsoft.AspNetCore.Mvc.Rendering.RenderMode.WebAssemblyPrerendered>
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{APP ASSEMBLY}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the following Razor Pages example, the `Counter` component is rendered in a page. To make the component interactive, the Blazor WebAssembly script is included in the page's [render section](xref:mvc/views/layout#sections). To avoid using the full namespace for the `Counter` component with the [Component Tag Helper](xref:mvc/views/tag-helpers/builtin-th/component-tag-helper) (`{ASSEMBLY NAME}.Pages.Counter`), add an [`@using`](xref:mvc/views/razor#using) directive for the client project's `Pages` namespace. In the following example, the **:::no-loc text="Client":::** project's namespace is `BlazorHosted.Client`.
In the **:::no-loc text="Server":::** project, `Pages/RazorPagesCounter1.cshtml`:

View File

@ -347,7 +347,7 @@ using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using static {APP ASSEMBLY}.Data;
using static {ASSEMBLY NAME}.Data;
public class WeatherForecastClient
{
@ -377,7 +377,7 @@ public class WeatherForecastClient
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
In `Program.cs`:
@ -1146,7 +1146,7 @@ using System.Net.Http;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Grpc.Net.Client;
using Grpc.Net.Client.Web;
using {APP ASSEMBLY}.Shared;
using {ASSEMBLY NAME}.Shared;
...
@ -1164,14 +1164,14 @@ builder.Services.AddScoped(sp =>
});
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
A component in the client app can make gRPC calls using the gRPC client (`Pages/Grpc.razor`):
```razor
@page "/grpc"
@using Microsoft.AspNetCore.Authorization
@using {APP ASSEMBLY}.Shared
@using {ASSEMBLY NAME}.Shared
@attribute [Authorize]
@inject Greeter.GreeterClient GreeterClient
@ -1206,7 +1206,7 @@ Server response: <strong>@serverResponse</strong>
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
For more information, see <xref:grpc/grpcweb>.
@ -1576,7 +1576,7 @@ using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using static {APP ASSEMBLY}.Data;
using static {ASSEMBLY NAME}.Data;
public class WeatherForecastClient
{
@ -1606,7 +1606,7 @@ public class WeatherForecastClient
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
In `Program.cs`:
@ -2377,7 +2377,7 @@ using System.Net.Http;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Grpc.Net.Client;
using Grpc.Net.Client.Web;
using {APP ASSEMBLY}.Shared;
using {ASSEMBLY NAME}.Shared;
...
@ -2395,14 +2395,14 @@ builder.Services.AddScoped(sp =>
});
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
A component in the client app can make gRPC calls using the gRPC client (`Pages/Grpc.razor`):
```razor
@page "/grpc"
@using Microsoft.AspNetCore.Authorization
@using {APP ASSEMBLY}.Shared
@using {ASSEMBLY NAME}.Shared
@attribute [Authorize]
@inject Greeter.GreeterClient GreeterClient
@ -2437,7 +2437,7 @@ Server response: <strong>@serverResponse</strong>
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
For more information, see <xref:grpc/grpcweb>.
@ -2805,7 +2805,7 @@ using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using static {APP ASSEMBLY}.Data;
using static {ASSEMBLY NAME}.Data;
public class WeatherForecastClient
{
@ -2835,7 +2835,7 @@ public class WeatherForecastClient
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
In `Program.cs`:
@ -3608,7 +3608,7 @@ using System.Net.Http;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Grpc.Net.Client;
using Grpc.Net.Client.Web;
using {APP ASSEMBLY}.Shared;
using {ASSEMBLY NAME}.Shared;
...
@ -3626,14 +3626,14 @@ builder.Services.AddScoped(sp =>
});
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
A component in the client app can make gRPC calls using the gRPC client (`Pages/Grpc.razor`):
```razor
@page "/grpc"
@using Microsoft.AspNetCore.Authorization
@using {APP ASSEMBLY}.Shared
@using {ASSEMBLY NAME}.Shared
@attribute [Authorize]
@inject Greeter.GreeterClient GreeterClient
@ -3668,7 +3668,7 @@ Server response: <strong>@serverResponse</strong>
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
For more information, see <xref:grpc/grpcweb>.
@ -4036,7 +4036,7 @@ using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using static {APP ASSEMBLY}.Data;
using static {ASSEMBLY NAME}.Data;
public class WeatherForecastClient
{
@ -4066,7 +4066,7 @@ public class WeatherForecastClient
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `using static BlazorSample.Data;`).
In `Program.cs`:
@ -4835,7 +4835,7 @@ using System.Net.Http;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Grpc.Net.Client;
using Grpc.Net.Client.Web;
using {APP ASSEMBLY}.Shared;
using {ASSEMBLY NAME}.Shared;
...
@ -4853,14 +4853,14 @@ builder.Services.AddScoped(sp =>
});
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). Place the `.proto` file in the `Shared` project of the hosted Blazor solution.
A component in the client app can make gRPC calls using the gRPC client (`Pages/Grpc.razor`):
```razor
@page "/grpc"
@using Microsoft.AspNetCore.Authorization
@using {APP ASSEMBLY}.Shared
@using {ASSEMBLY NAME}.Shared
@attribute [Authorize]
@inject Greeter.GreeterClient GreeterClient
@ -4895,7 +4895,7 @@ Server response: <strong>@serverResponse</strong>
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample`). To use the `Status.DebugException` property, use [`Grpc.Net.Client`](https://www.nuget.org/packages/Grpc.Net.Client) version 2.30.0 or later.
For more information, see <xref:grpc/grpcweb>.

View File

@ -251,15 +251,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -661,15 +661,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -1071,15 +1071,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -1477,15 +1477,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).

View File

@ -248,15 +248,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -651,15 +651,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -1054,15 +1054,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).
@ -1451,15 +1451,15 @@ Support for <xref:System.Net.Http.HttpClient> instances is added that include ac
`Program.cs`:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI", client =>
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI", client =>
client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
Support for authenticating users is registered in the service container with the <xref:Microsoft.Extensions.DependencyInjection.MsalWebAssemblyServiceCollectionExtensions.AddMsalAuthentication%2A> extension method provided by the [`Microsoft.Authentication.WebAssembly.Msal`](https://www.nuget.org/packages/Microsoft.Authentication.WebAssembly.Msal) package. This method sets up the services required for the app to interact with the Identity Provider (IP).

View File

@ -159,14 +159,14 @@ In the app settings file (`appsettings.json`) at the project root, the `Identity
```json
"IdentityServer": {
"Clients": {
"{APP ASSEMBLY}.Client": {
"{ASSEMBLY NAME}.Client": {
"Profile": "IdentityServerSPA"
}
}
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
## **:::no-loc text="Client":::** app configuration
@ -180,18 +180,18 @@ If adding authentication to an app, manually add the [`Microsoft.AspNetCore.Comp
### `HttpClient` configuration
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{APP ASSEMBLY}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{ASSEMBLY NAME}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI",
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI",
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
> [!NOTE]
> If you're configuring a Blazor WebAssembly app to use an existing Identity Server instance that isn't part of a hosted Blazor solution, change the <xref:System.Net.Http.HttpClient> base address registration from <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment.BaseAddress?displayProperty=nameWithType> (`builder.HostEnvironment.BaseAddress`) to the server app's API authorization endpoint URL.
@ -702,14 +702,14 @@ In the app settings file (`appsettings.json`) at the project root, the `Identity
```json
"IdentityServer": {
"Clients": {
"{APP ASSEMBLY}.Client": {
"{ASSEMBLY NAME}.Client": {
"Profile": "IdentityServerSPA"
}
}
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
## **:::no-loc text="Client":::** app configuration
@ -723,18 +723,18 @@ If adding authentication to an app, manually add the [`Microsoft.AspNetCore.Comp
### `HttpClient` configuration
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{APP ASSEMBLY}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{ASSEMBLY NAME}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI",
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI",
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
> [!NOTE]
> If you're configuring a Blazor WebAssembly app to use an existing Identity Server instance that isn't part of a hosted Blazor solution, change the <xref:System.Net.Http.HttpClient> base address registration from <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment.BaseAddress?displayProperty=nameWithType> (`builder.HostEnvironment.BaseAddress`) to the server app's API authorization endpoint URL.
@ -1242,14 +1242,14 @@ In the app settings file (`appsettings.json`) at the project root, the `Identity
```json
"IdentityServer": {
"Clients": {
"{APP ASSEMBLY}.Client": {
"{ASSEMBLY NAME}.Client": {
"Profile": "IdentityServerSPA"
}
}
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
## **:::no-loc text="Client":::** app configuration
@ -1263,18 +1263,18 @@ If adding authentication to an app, manually add the [`Microsoft.AspNetCore.Comp
### `HttpClient` configuration
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{APP ASSEMBLY}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{ASSEMBLY NAME}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI",
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI",
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
> [!NOTE]
> If you're configuring a Blazor WebAssembly app to use an existing Identity Server instance that isn't part of a hosted Blazor solution, change the <xref:System.Net.Http.HttpClient> base address registration from <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment.BaseAddress?displayProperty=nameWithType> (`builder.HostEnvironment.BaseAddress`) to the server app's API authorization endpoint URL.
@ -1952,14 +1952,14 @@ In the app settings file (`appsettings.json`) at the project root, the `Identity
```json
"IdentityServer": {
"Clients": {
"{APP ASSEMBLY}.Client": {
"{ASSEMBLY NAME}.Client": {
"Profile": "IdentityServerSPA"
}
}
}
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
## **:::no-loc text="Client":::** app configuration
@ -1973,18 +1973,18 @@ If adding authentication to an app, manually add the [`Microsoft.AspNetCore.Comp
### `HttpClient` configuration
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{APP ASSEMBLY}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
In `Program.cs`, a named <xref:System.Net.Http.HttpClient> (`{ASSEMBLY NAME}.ServerAPI`) is configured to supply <xref:System.Net.Http.HttpClient> instances that include access tokens when making requests to the server API:
```csharp
builder.Services.AddHttpClient("{APP ASSEMBLY}.ServerAPI",
builder.Services.AddHttpClient("{ASSEMBLY NAME}.ServerAPI",
client => client.BaseAddress = new Uri(builder.HostEnvironment.BaseAddress))
.AddHttpMessageHandler<BaseAddressAuthorizationMessageHandler>();
builder.Services.AddScoped(sp => sp.GetRequiredService<IHttpClientFactory>()
.CreateClient("{APP ASSEMBLY}.ServerAPI"));
.CreateClient("{ASSEMBLY NAME}.ServerAPI"));
```
The placeholder `{APP ASSEMBLY}` is the app's assembly name (for example, `BlazorSample.Client`).
The placeholder `{ASSEMBLY NAME}` is the app's assembly name (for example, `BlazorSample.Client`).
> [!NOTE]
> If you're configuring a Blazor WebAssembly app to use an existing Identity Server instance that isn't part of a hosted Blazor solution, change the <xref:System.Net.Http.HttpClient> base address registration from <xref:Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment.BaseAddress?displayProperty=nameWithType> (`builder.HostEnvironment.BaseAddress`) to the server app's API authorization endpoint URL.