Skip to content

Commit 346b714

Browse files
authored
Merge pull request #35574 from dotnet/main
2 parents 21dfce8 + c177395 commit 346b714

File tree

8 files changed

+42
-24
lines changed

8 files changed

+42
-24
lines changed

aspnetcore/blazor/call-web-api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ In the app's `Program` file, call:
6060
<!-- UPDATE 10.0 - Missing API doc for 'AddDownstreamApi' -->
6161

6262
* <xref:Microsoft.Identity.Web.MicrosoftIdentityWebApiAuthenticationBuilder.EnableTokenAcquisitionToCallDownstreamApi%2A>: Enables token acquisition to call web APIs.
63-
* `AddDownstreamApi`: Adds a named downstream web service related to a specific configuration section.
63+
* `AddDownstreamApi`: Microsoft Identity Web packages provide API to create a named downstream web service for making web API calls. <xref:Microsoft.Identity.Abstractions.IDownstreamApi> is injected into a server-side class, which is used to call <xref:Microsoft.Identity.Abstractions.IDownstreamApi.CallApiForUserAsync%2A> to obtain weather data from an external web API (`MinimalApiJwt` project).
6464
* <xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.DistributedTokenCacheAdapterExtension.AddDistributedTokenCaches%2A>: Adds the .NET Core distributed token caches to the service collection.
6565
* <xref:Microsoft.Extensions.DependencyInjection.MemoryCacheServiceCollectionExtensions.AddDistributedMemoryCache%2A>: Adds a default implementation of <xref:Microsoft.Extensions.Caching.Distributed.IDistributedCache> that stores cache items in memory.
6666
* Configure the distributed token cache options (<xref:Microsoft.Identity.Web.TokenCacheProviders.Distributed.MsalDistributedTokenCacheAdapterOptions>):
@@ -234,6 +234,7 @@ This approach is used by the `BlazorWebAppEntra` and `BlazorWebAppEntraBff` samp
234234
For more information, see the following resources:
235235
236236
* [Web API documentation | Microsoft identity platform](/entra/identity-platform/index-web-api)
237+
* [A web API that calls web APIs: Call an API: Option 2: Call a downstream web API with the helper class](/entra/identity-platform/scenario-web-api-call-api-call-api?tabs=aspnetcore#option-2-call-a-downstream-web-api-with-the-helper-class)
237238
* <xref:Microsoft.Identity.Abstractions.IDownstreamApi>
238239
* *Secure an ASP.NET Core Blazor Web App with Microsoft Entra ID*
239240
* [Non-BFF pattern (Interactive Auto)](xref:blazor/security/blazor-web-app-entra?pivots=non-bff-pattern)

aspnetcore/blazor/security/blazor-web-app-with-entra.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The following specification is covered:
3030
* The app uses [Microsoft Entra ID](https://www.microsoft.com/security/business/microsoft-entra), based on [Microsoft Identity Web](/entra/msal/dotnet/microsoft-identity-web/) packages.
3131
* Automatic non-interactive token refresh is managed by the framework.
3232
* The app uses server-side and client-side service abstractions to display generated weather data:
33-
* When rendering the `Weather` component on the server to display weather data, the component uses the `ServerWeatherForecaster` on the server to obtain weather data.
33+
* When rendering the `Weather` component on the server to display weather data, the component uses the `ServerWeatherForecaster`. Microsoft Identity Web packages provide API to create a named downstream web service for making web API calls. <xref:Microsoft.Identity.Abstractions.IDownstreamApi> is injected into the `ServerWeatherForecaster`, which is used to call <xref:Microsoft.Identity.Abstractions.IDownstreamApi.CallApiForUserAsync%2A> to obtain weather data from an external web API (`MinimalApiJwt` project).
3434
* When the `Weather` component is rendered on the client, the component uses the `ClientWeatherForecaster` service implementation, which uses a preconfigured <xref:System.Net.Http.HttpClient> (in the client project's `Program` file) to make a web API call to the server project's Minimal API (`/weather-forecast`) for weather data. The Minimal API endpoint obtains the weather data from the `ServerWeatherForecaster` class and returns it to the client for rendering by the component.
3535

3636
## Sample solution
@@ -216,11 +216,13 @@ The following specification is covered:
216216
* The server project calls <xref:Microsoft.Extensions.DependencyInjection.WebAssemblyRazorComponentsBuilderExtensions.AddAuthenticationStateSerialization%2A> to add a server-side authentication state provider that uses <xref:Microsoft.AspNetCore.Components.PersistentComponentState> to flow the authentication state to the client. The client calls <xref:Microsoft.Extensions.DependencyInjection.WebAssemblyAuthenticationServiceCollectionExtensions.AddAuthenticationStateDeserialization%2A> to deserialize and use the authentication state passed by the server. The authentication state is fixed for the lifetime of the WebAssembly application.
217217
* The app uses [Microsoft Entra ID](https://www.microsoft.com/security/business/microsoft-entra), based on [Microsoft Identity Web](/entra/msal/dotnet/microsoft-identity-web/) packages.
218218
* Automatic non-interactive token refresh is managed by the framework.
219-
* The app uses server-side and client-side service abstractions to display generated weather data.
220219
* The [Backend for Frontend (BFF) pattern](/azure/architecture/patterns/backends-for-frontends) is adopted using [.NET Aspire](/dotnet/aspire/get-started/aspire-overview) for service discovery and [YARP](https://dotnet.github.io/yarp/) for proxying requests to a weather forecast endpoint on the backend app.
221220
* A backend web API uses JWT-bearer authentication to validate JWT tokens saved by the Blazor Web App in the sign-in cookie.
222221
* Aspire improves the experience of building .NET cloud-native apps. It provides a consistent, opinionated set of tools and patterns for building and running distributed apps.
223222
* YARP (Yet Another Reverse Proxy) is a library used to create a reverse proxy server.
223+
* The app uses server-side and client-side service abstractions to display generated weather data.
224+
* When rendering the `Weather` component on the server to display weather data, the component uses the `ServerWeatherForecaster`. Microsoft Identity Web packages provide API to create a named downstream web service for making web API calls. <xref:Microsoft.Identity.Abstractions.IDownstreamApi> is injected into the `ServerWeatherForecaster`, which is used to call <xref:Microsoft.Identity.Abstractions.IDownstreamApi.CallApiForUserAsync%2A> to obtain weather data from an external web API (`MinimalApiJwt` project).
225+
* When the `Weather` component is rendered on the client, the component uses the `ClientWeatherForecaster` service implementation, which uses a preconfigured <xref:System.Net.Http.HttpClient> (in the client project's `Program` file) to make a web API call to the server project's Minimal API (`/weather-forecast`) for weather data. The Minimal API endpoint obtains an access token for the user by calling <xref:Microsoft.Identity.Web.ITokenAcquisition.GetAccessTokenForUserAsync%2A>. Along with the correct scopes, a reverse proxy call is made to the external web API (`MinimalApiJwt` project) to obtain and return weather data to the client for rendering by the component.
224226

225227
<!-- UPDATE 10.0 Remove at 10.0 -->
226228

@@ -937,7 +939,10 @@ For more information on how this app secures its weather data, see [Secure data
937939

938940
## Additional resources
939941

942+
* [Call a web API from an ASP.NET Core Blazor app: Microsoft identity platform for web API calls](xref:blazor/call-web-api#microsoft-identity-platform-for-web-api-calls)
940943
* [Microsoft identity platform documentation](/entra/identity-platform/)
944+
* [Web API documentation | Microsoft identity platform](/entra/identity-platform/index-web-api)
945+
* [A web API that calls web APIs: Call an API: Option 2: Call a downstream web API with the helper class](/entra/identity-platform/scenario-web-api-call-api-call-api?tabs=aspnetcore#option-2-call-a-downstream-web-api-with-the-helper-class)
941946
* [`AzureAD/microsoft-identity-web` GitHub repository](https://github.com/AzureAD/microsoft-identity-web/wiki): Helpful guidance on implementing Microsoft Identity Web for Microsoft Entra ID and Azure Active Directory B2C for ASP.NET Core apps, including links to sample apps and related Azure documentation. Currently, Blazor Web Apps aren't explicitly addressed by the Azure documentation, but the setup and configuration of a Blazor Web App for ME-ID and Azure hosting is the same as it is for any ASP.NET Core web app.
942947
* [`AuthenticationStateProvider` service](xref:blazor/security/index#authenticationstateprovider-service)
943948
* [Manage authentication state in Blazor Web Apps](xref:blazor/security/index#manage-authentication-state-in-blazor-web-apps)

aspnetcore/fundamentals/map-static-files.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
title: Map static files in ASP.NET Core
33
author: rick-anderson
44
description: Learn how to serve and secure mapped static files and configure static file hosting middleware behaviors in an ASP.NET Core web app.
5-
monikerRange: '>= aspnetcore-8.0'
5+
monikerRange: '>= aspnetcore-9.0'
66
ms.author: riande
77
ms.custom: mvc
88
ms.date: 3/18/2025
99
uid: fundamentals/map-static-files
1010
---
1111
# Map static files in ASP.NET Core
1212

13-
:::moniker range=">= aspnetcore-9.0"
13+
<!-- UPDATE 10.0 - Activate at GA
14+
15+
[!INCLUDE[](~/includes/not-latest-version.md)]
16+
17+
-->
1418

1519
By [Rick Anderson](https://twitter.com/RickAndMSFT)
1620

@@ -209,5 +213,3 @@ The following code updates `IWebHostEnvironment.WebRootPath` to a non developmen
209213
* [Introduction to ASP.NET Core](xref:index)
210214
* <xref:blazor/file-uploads>
211215
* <xref:blazor/file-downloads>
212-
213-
:::moniker-end

aspnetcore/fundamentals/servers/kestrel/http3.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,14 @@ uid: fundamentals/servers/kestrel/http3
2727
* Is the latest version of the Hypertext Transfer Protocol.
2828
* Builds on the strengths of `HTTP/2` while addressing some of its limitations, particularly in terms of performance, latency, reliability, and security.
2929

30-
+---------------+-------------------------+-------------------------+
31-
| Feature | `HTTP/2` | `HTTP/3` |
32-
+---------------+-------------------------+-------------------------+
33-
| Transport | Uses [TCP](https://developer.mozilla.org/docs/Glossary/TCP) | Uses [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html) |
34-
| Layer | | |
35-
| Connection | Slower due to TCP + TLS | Faster with 0-RTT QUIC |
36-
| Setup | handshake | handshakes |
37-
| Head-of-Line | Affected by TCP-level | Eliminated with QUIC |
38-
| Blocking | blocking | stream multiplexing |
39-
| Encryption | TLS over TCP | TLS is built into QUIC |
40-
+---------------+-------------------------+-------------------------+
41-
30+
| Feature | `HTTP/2` | `HTTP/3` |
31+
|--------------|-------------------------------------------------------------|----------------------------------------------------------|
32+
| Transport | Uses [TCP](https://developer.mozilla.org/docs/Glossary/TCP) | Uses [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html) |
33+
| Connection | Slower due to TCP + TLS | Faster with 0-RTT QUIC |
34+
| Setup | handshake | handshakes |
35+
| Head-of-Line | Affected by TCP-level | Eliminated with QUIC |
36+
| Blocking | blocking | stream multiplexing |
37+
| Encryption | TLS over TCP | TLS is built into QUIC |
4238

4339
The key differences from `HTTP/2` to `HTTP/3` are:
4440

aspnetcore/mvc/views/razor.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ Extra `@` characters in a Razor file can cause compiler errors at statements lat
261261

262262
### Conditional attribute rendering
263263

264-
Razor automatically omits attributes that aren't needed. If the value passed in is `null` or `false`, the attribute isn't rendered.
264+
Razor automatically omits attributes that aren't required. If the value passed in is `null` or `false`, the attribute isn't rendered.
265265

266-
For example, consider the following razor:
266+
For example, consider the following Razor markup:
267267

268268
```cshtml
269269
<div class="@false">False</div>
@@ -289,6 +289,20 @@ The preceding Razor markup generates the following HTML:
289289
<input type="checkbox" name="null">
290290
```
291291

292+
Razor retains `data-` attributes if their values are `null` or `false`.
293+
294+
Consider the following Razor markup:
295+
296+
```cshtml
297+
<div data-id="@null" data-active="@false"></div>
298+
```
299+
300+
The preceding Razor markup generates the following HTML:
301+
302+
```html
303+
<div data-id="" data-active="False"></div>
304+
```
305+
292306
## Control structures
293307

294308
Control structures are an extension of code blocks. All aspects of code blocks (transitioning to markup, inline C#) also apply to the following structures:

aspnetcore/release-notes/aspnetcore-2.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For more information, see [in-process hosting for IIS](xref:host-and-deploy/aspn
7777

7878
ASP.NET Core 2.2 introduces a Java Client for SignalR. This client supports connecting to an ASP.NET Core SignalR Server from Java code, including Android apps.
7979

80-
For more information, see [ASP.NET Core SignalR Java client](../signalr/java-client.md?view=aspnetcore-2.2).
80+
For more information, see [ASP.NET Core SignalR Java client](../signalr/java-client.md?view=aspnetcore-2.2&preserve-view=true).
8181

8282
## CORS improvements
8383

aspnetcore/security/authentication/identity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ To prevent publishing static Identity assets (stylesheets and JavaScript files f
253253
* <xref:security/authentication/identity-enable-qrcodes>
254254
* <xref:migration/identity>
255255
* <xref:security/authentication/accconfirm>
256-
* <xref:security/authentication/2fa>
256+
* <xref:security/authentication/mfa>
257257
* <xref:host-and-deploy/web-farm>
258258

259259
:::moniker-end

aspnetcore/security/how-to-choose-identity-solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Most web apps support authentication to ensure that users are who they claim to
1717
ASP.NET Core ships with a built-in authentication provider: [ASP.NET Core Identity](xref:security/authentication/identity). The provider includes the APIs, UI, and backend database configuration to support managing user identities, storing user credentials, and granting or revoking permissions. Other features it supports include:
1818

1919
* [External logins](xref:security/authentication/social/index)
20-
* [Two-factor authentication (2FA)](xref:security/authentication/2fa)
20+
* [Multi-factor authentication (MFA)](xref:security/authentication/mfa)
2121
* [Password management](xref:security/authentication/accconfirm)
2222
* Account lockout and reactivation
2323
* Authenticator apps

0 commit comments

Comments
 (0)