From 8c5756e8fa723d7246577352a54ba1a491f624ef Mon Sep 17 00:00:00 2001 From: guardrex <1622880+guardrex@users.noreply.github.com> Date: Thu, 7 Apr 2022 08:03:51 -0500 Subject: [PATCH 1/5] Blazor Hybrid Security topic --- aspnetcore/blazor/hybrid/security/index.md | 70 ++++++++++++++++++++++ aspnetcore/blazor/hybrid/tutorials/maui.md | 2 +- aspnetcore/toc.yml | 2 + 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 aspnetcore/blazor/hybrid/security/index.md diff --git a/aspnetcore/blazor/hybrid/security/index.md b/aspnetcore/blazor/hybrid/security/index.md new file mode 100644 index 000000000000..4f41ce7e8603 --- /dev/null +++ b/aspnetcore/blazor/hybrid/security/index.md @@ -0,0 +1,70 @@ +--- +title: ASP.NET Core Blazor Hybrid authentication and authorization +author: guardrex +description: Learn about Blazor Hybrid authentication and authorization scenarios. +monikerRange: '>= aspnetcore-6.0' +ms.author: riande +ms.custom: mvc +ms.date: 04/07/2022 +no-loc: [".NET MAUI", "Mac Catalyst", "Blazor Hybrid", Home, Privacy, Kestrel, appsettings.json, "ASP.NET Core Identity", cookie, Cookie, Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR] +uid: blazor/hybrid/security/index +--- +# ASP.NET Core Blazor Hybrid authentication and authorization + +This article describes ASP.NET Core's support for the configuration and management of security in Blazor Hybrid apps. + +## Untrusted and unencoded content + +Avoid allowing an app render untrusted and unencoded content from a database or other resource, such as user-provided comments, in its rendered UI. Permitting untrusted, unencoded content to render can cause malicious code to execute. + +## External content rendered in an `iframe` + +When using an [`iframe`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe) to display external content within a Blazor Hybrid page, we recommend that users leverage sandboxing features to ensure that the content is isolated from the parent page containing the app. In the following example, the [`sandbox` attribute](https://developer.mozilla.org/docs/Web/HTML/Element/iframe) is present for the `