Skip to content

Commit ec3a7c7

Browse files
Merge pull request #34982 from dotnet/main
Merge to Live
2 parents 33f5a3e + 78d5e21 commit ec3a7c7

25 files changed

+1087
-422
lines changed

.github/policies/pullRequestManagement-labelFiles.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,6 @@ configuration:
2121
targetsBranch:
2222
branch: live
2323
then:
24-
- if:
25-
- filesMatchPattern:
26-
matchAny: true
27-
pattern: '(?i).*/blazor/hybrid/.*'
28-
then:
29-
- requestReview:
30-
reviewer: guardrex
31-
- addLabel:
32-
label: 'blazor-hybrid/subsvc'
3324
- if:
3425
- or:
3526
- filesMatchPattern:

aspnetcore/blazor/call-web-api.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The [`System.Net.Http.Json`](https://www.nuget.org/packages/System.Net.Http.Json
2222

2323
## Sample apps
2424

25-
See the sample apps in the [`dotnet/blazor-samples`](https://github.com/dotnet/blazor-samples/) GitHub repository.
25+
For working examples, see the following sample apps in the [Blazor samples GitHub repository (`dotnet/blazor-samples`)](https://github.com/dotnet/blazor-samples/) ([how to download](xref:blazor/fundamentals/index#sample-apps)).
2626

2727
### `BlazorWebAppCallWebApi`
2828

@@ -80,6 +80,8 @@ public class ServerMovieService(MovieContext db) : IMovieService
8080
}
8181
```
8282

83+
For more information on how to secure movie data in this scenario, see the weather data example described by [Secure data in Blazor Web Apps with Interactive Auto rendering](xref:blazor/security/index#secure-data-in-blazor-web-apps-with-interactive-auto-rendering).
84+
8385
### `BlazorWebAppCallWebApi_Weather`
8486

8587
A weather data sample app that uses streaming rendering for weather data.
@@ -91,6 +93,40 @@ Calls a todo list web API from a Blazor WebAssembly app:
9193
* `Backend`: A web API app for maintaining a todo list, based on [Minimal APIs](xref:fundamentals/minimal-apis).
9294
* `BlazorTodo`: A Blazor WebAssembly app that calls the web API with a preconfigured <xref:System.Net.Http.HttpClient> for todo list CRUD operations.
9395

96+
### `BlazorWebAssemblyStandaloneWithIdentity`
97+
98+
A standalone Blazor WebAssembly app secured with ASP.NET Core Identity:
99+
100+
* `Backend`: A backend web API app that maintains a user identity store for ASP.NET Core Identity.
101+
* `BlazorWasmAuth`: A standalone Blazor WebAssembly frontend app with user authentication.
102+
103+
The solution demonstrates calling a secure web API for the following:
104+
105+
* Obtaining an authenticated user's roles.
106+
* Data processing for all authenticated users.
107+
* Data processing for authorized users (the user must be in the `Manager` role) via an [authorization policy](xref:security/authorization/policies).
108+
109+
### `BlazorWebAppOidc`
110+
111+
A Blazor Web App with global Auto interactivity that uses OIDC authentication with Microsoft Entra without using Entra-specific packages. The solution includes a demonstration of obtaining weather data securely via a web API when a component that adopts Interactive Auto rendering is rendered on the client.
112+
113+
### `BlazorWebAppOidcBff`
114+
115+
A Blazor Web App with global Auto interactivity that uses:
116+
117+
* OIDC authentication with Microsoft Entra without using Entra-specific packages.
118+
* The [Backend for Frontend (BFF) pattern](/azure/architecture/patterns/backends-for-frontends), which is a pattern of app development that creates backend services for frontend apps or interfaces.
119+
120+
The solution includes a demonstration of obtaining weather data securely via a web API when a component that adopts Interactive Auto rendering is rendered on the client.
121+
122+
:::moniker-end
123+
124+
:::moniker range=">= aspnetcore-9.0"
125+
126+
### `BlazorWebAppEntra`
127+
128+
A Blazor Web App with global Auto interactivity that uses [Microsoft identity platform](/entra/identity-platform/)/[Microsoft Identity Web packages](/entra/msal/dotnet/microsoft-identity-web/) for [Microsoft Entra ID](https://www.microsoft.com/security/business/microsoft-entra). The solution includes a demonstration of obtaining weather data securely via a web API when a component that adopts Interactive Auto rendering is rendered on the client.
129+
94130
:::moniker-end
95131

96132
## Client-side scenarios for calling external web APIs
@@ -1050,9 +1086,21 @@ Various network tools are publicly available for testing web API backend apps di
10501086

10511087
### General
10521088

1089+
:::moniker range=">= aspnetcore-8.0"
1090+
1091+
* [Cross-Origin Resource Sharing (CORS) at W3C](https://www.w3.org/TR/cors/)
1092+
* <xref:security/cors>: Although the content applies to ASP.NET Core apps, not Razor components, the article covers general CORS concepts.
1093+
* [Secure data in Blazor Web Apps with Interactive Auto rendering](xref:blazor/security/index#secure-data-in-blazor-web-apps-with-interactive-auto-rendering)
1094+
1095+
:::moniker-end
1096+
1097+
:::moniker range="< aspnetcore-8.0"
1098+
10531099
* [Cross-Origin Resource Sharing (CORS) at W3C](https://www.w3.org/TR/cors/)
10541100
* <xref:security/cors>: Although the content applies to ASP.NET Core apps, not Razor components, the article covers general CORS concepts.
10551101

1102+
:::moniker-end
1103+
10561104
### Mitigation of overposting attacks
10571105

10581106
Web APIs can be vulnerable to an *overposting* attack, also known as a *mass assignment* attack. An overposting attack occurs when a malicious user issues an HTML form POST to the server that processes data for properties that aren't part of the rendered form and that the developer doesn't wish to allow users to modify. The term "overposting" literally means that the malicious user has *over*-POSTed with the form.

0 commit comments

Comments
 (0)