Skip to content

Commit 7e970a8

Browse files
Merge pull request #33971 from dotnet/main
Merge to Live
2 parents a858d5f + 8b73f0a commit 7e970a8

File tree

17 files changed

+75
-16
lines changed

17 files changed

+75
-16
lines changed

aspnetcore/fundamentals/configuration/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ms.custom: mvc
88
ms.date: 04/26/2024
99
uid: fundamentals/configuration/index
1010
---
11+
<!-- ms.sfi.ropc: t -->
1112
# Configuration in ASP.NET Core
1213

1314
By [Rick Anderson](https://twitter.com/RickAndMSFT) and [Kirk Larkin](https://twitter.com/serpent5)
@@ -158,15 +159,15 @@ Configuration data guidelines:
158159
* Never store passwords or other sensitive data in configuration provider code or in plain text configuration files. The [Secret Manager](xref:security/app-secrets) tool can be used to store secrets in development.
159160
* Don't use production secrets in development or test environments.
160161
* Specify secrets outside of the project so that they can't be accidentally committed to a source code repository.
162+
* Production apps should use the most secure authentication flow available. For more information, see [Secure authentication flows](xref:security/index#secure-authentication-flows).
161163

162164
By [default](#default), the user secrets configuration source is registered after the JSON configuration sources. Therefore, user secrets keys take precedence over keys in `appsettings.json` and `appsettings.{Environment}.json`.
163165

164166
For more information on storing passwords or other sensitive data:
165167

166168
* <xref:fundamentals/environments>
167169
* <xref:security/app-secrets>: Includes advice on using environment variables to store sensitive data. The Secret Manager tool uses the [File configuration provider](#fcp) to store user secrets in a JSON file on the local system.
168-
169-
[Azure Key Vault](https://azure.microsoft.com/services/key-vault/) safely stores app secrets for ASP.NET Core apps. For more information, see <xref:security/key-vault-configuration>.
170+
* [Azure Key Vault](https://azure.microsoft.com/services/key-vault/) safely stores app secrets for ASP.NET Core apps. For more information, see <xref:security/key-vault-configuration>.
170171

171172
<a name="evcp"></a>
172173

@@ -408,6 +409,8 @@ The preferred way to read hierarchical configuration data is using the options p
408409

409410
## Configuration keys and values
410411

412+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
413+
411414
Configuration keys:
412415

413416
* Are case-insensitive. For example, `ConnectionString` and `connectionstring` are treated as equivalent keys.
@@ -459,6 +462,8 @@ The preceding sequence of providers is used in the [default configuration](#defa
459462

460463
### Connection string prefixes
461464

465+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
466+
462467
The Configuration API has special processing rules for four connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the table are loaded into the app with the [default configuration](#default) or when no prefix is supplied to `AddEnvironmentVariables`.
463468

464469
| Connection string prefix | Provider |

aspnetcore/fundamentals/configuration/index/includes/index3-5.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:::moniker range=">= aspnetcore-5.0 < aspnetcore-6.0"
2-
2+
<!-- ms.sfi.ropc: t -->
33
<a name="kestrel"></a>
44

55
## Kestrel endpoint configuration
@@ -149,6 +149,8 @@ Custom configuration providers aren't required to implement array binding.
149149

150150
## Custom configuration provider
151151

152+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
153+
152154
The sample app demonstrates how to create a basic configuration provider that reads configuration key-value pairs from a database using [Entity Framework (EF)](/ef/core/).
153155

154156
The provider has the following characteristics:

aspnetcore/fundamentals/configuration/index/includes/index6.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:::moniker range="= aspnetcore-6.0"
2-
2+
<!-- ms.sfi.ropc: t -->
33
Application configuration in ASP.NET Core is performed using one or more [configuration providers](#cp). Configuration providers read configuration data from key-value pairs using a variety of configuration sources:
44

55
* Settings files, such as `appsettings.json`
@@ -135,6 +135,7 @@ Configuration data guidelines:
135135
* Never store passwords or other sensitive data in configuration provider code or in plain text configuration files. The [Secret Manager](xref:security/app-secrets) tool can be used to store secrets in development.
136136
* Don't use production secrets in development or test environments.
137137
* Specify secrets outside of the project so that they can't be accidentally committed to a source code repository.
138+
* Production apps should use the most secure authentication flow available. For more information, see [Secure authentication flows](xref:security/index#secure-authentication-flows).
138139

139140
By [default](#default), the user secrets configuration source is registered after the JSON configuration sources. Therefore, user secrets keys take precedence over keys in `appsettings.json` and `appsettings.{Environment}.json`.
140141

@@ -385,6 +386,8 @@ The preferred way to read hierarchical configuration data is using the options p
385386

386387
## Configuration keys and values
387388

389+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
390+
388391
Configuration keys:
389392

390393
* Are case-insensitive. For example, `ConnectionString` and `connectionstring` are treated as equivalent keys.
@@ -436,6 +439,8 @@ The preceding sequence of providers is used in the [default configuration](#defa
436439

437440
### Connection string prefixes
438441

442+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
443+
439444
The Configuration API has special processing rules for four connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the table are loaded into the app with the [default configuration](#default) or when no prefix is supplied to `AddEnvironmentVariables`.
440445

441446
| Connection string prefix | Provider |

aspnetcore/fundamentals/configuration/index/includes/index7.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:::moniker range="= aspnetcore-7.0"
2-
2+
<!-- ms.sfi.ropc: t -->
33
Application configuration in ASP.NET Core is performed using one or more [configuration providers](#cp). Configuration providers read configuration data from key-value pairs using a variety of configuration sources:
44

55
* Settings files, such as `appsettings.json`
@@ -140,6 +140,7 @@ Configuration data guidelines:
140140
* Never store passwords or other sensitive data in configuration provider code or in plain text configuration files. The [Secret Manager](xref:security/app-secrets) tool can be used to store secrets in development.
141141
* Don't use production secrets in development or test environments.
142142
* Specify secrets outside of the project so that they can't be accidentally committed to a source code repository.
143+
* Production apps should use the most secure authentication flow available. For more information, see [Secure authentication flows](xref:security/index#secure-authentication-flows).
143144

144145
By [default](#default), the user secrets configuration source is registered after the JSON configuration sources. Therefore, user secrets keys take precedence over keys in `appsettings.json` and `appsettings.{Environment}.json`.
145146

@@ -390,6 +391,8 @@ The preferred way to read hierarchical configuration data is using the options p
390391

391392
## Configuration keys and values
392393

394+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
395+
393396
Configuration keys:
394397

395398
* Are case-insensitive. For example, `ConnectionString` and `connectionstring` are treated as equivalent keys.
@@ -441,6 +444,8 @@ The preceding sequence of providers is used in the [default configuration](#defa
441444

442445
### Connection string prefixes
443446

447+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
448+
444449
The Configuration API has special processing rules for four connection string environment variables. These connection strings are involved in configuring Azure connection strings for the app environment. Environment variables with the prefixes shown in the table are loaded into the app with the [default configuration](#default) or when no prefix is supplied to `AddEnvironmentVariables`.
445450

446451
| Connection string prefix | Provider |

aspnetcore/fundamentals/use-http-context.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ author: jamesnk
44
description: How to use HttpContext in ASP.NET Core.
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: wpickett
7-
ms.date: 01/31/2022
7+
ms.date: 10/07/2024
88
uid: fundamentals/use-httpcontext
99
---
10+
<!-- ms.sfi.ropc: t -->
11+
1012
# Use HttpContext in ASP.NET Core
1113

1214
[!INCLUDE[](~/includes/not-latest-version.md)]
@@ -28,7 +30,7 @@ Commonly used members on `HttpRequest` include:
2830
|<xref:Microsoft.AspNetCore.Http.HttpRequest.Headers?displayProperty=nameWithType>|A collection of request headers.|`user-agent=Edge`<br />`x-custom-header=MyValue`|
2931
|<xref:Microsoft.AspNetCore.Http.HttpRequest.RouteValues?displayProperty=nameWithType>|A collection of route values. The collection is set when the request is matched to a route.|`language=en`<br />`article=getstarted`|
3032
|<xref:Microsoft.AspNetCore.Http.HttpRequest.Query?displayProperty=nameWithType>|A collection of query values parsed from <xref:Microsoft.AspNetCore.Http.HttpRequest.QueryString>.|`filter=hello`<br />`page=1`|
31-
|[HttpRequest.ReadFormAsync()](xref:Microsoft.AspNetCore.Http.HttpRequest.ReadFormAsync(System.Threading.CancellationToken))|A method that reads the request body as a form and returns a form values collection. For information about why `ReadFormAsync` should be used to access form data, see [Prefer ReadFormAsync over Request.Form](xref:fundamentals/best-practices#prefer-readformasync-over-requestform).|`[email protected]`<br />`password=TNkt4taM`|
33+
|[HttpRequest.ReadFormAsync()](xref:Microsoft.AspNetCore.Http.HttpRequest.ReadFormAsync(System.Threading.CancellationToken))|A method that reads the request body as a form and returns a form values collection. For information about why `ReadFormAsync` should be used to access form data, see [Prefer ReadFormAsync over Request.Form](xref:fundamentals/best-practices#prefer-readformasync-over-requestform).|`[email protected]`|
3234
|<xref:Microsoft.AspNetCore.Http.HttpRequest.Body?displayProperty=nameWithType>|A <xref:System.IO.Stream> for reading the request body.|UTF-8 JSON payload|
3335

3436
### Get request headers
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
author: tdykstra
3+
ms.author: tdykstra
4+
ms.date: 10/16/2024
5+
ms.topic: include
6+
---
7+
<!-- ms.sfi.ropc: t -->
8+
> [!WARNING]
9+
> This article shows the use of connection strings. With a local database the user doesn't have to be authenticated, but in production, connection strings sometimes include a password to authenticate. A resource owner password credential (ROPC) is a security risk that should be avoided in production databases. Production apps should use the most secure authentication flow available. For more information on authentication for apps deployed to test or production environments, see [Secure authentication flows](xref:security/index#secure-authentication-flows).

aspnetcore/migration/identity.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ title: Migrate Authentication and Identity to ASP.NET Core
33
author: ardalis
44
description: Learn how to migrate authentication and identity from an ASP.NET MVC project to an ASP.NET Core MVC project.
55
ms.author: riande
6-
ms.date: 3/22/2020
6+
ms.date: 10/29/2024
77
uid: migration/identity
88
---
9+
<!-- ms.sfi.ropc: t -->
910
# Migrate Authentication and Identity to ASP.NET Core
1011

1112
By [Steve Smith](https://ardalis.com/)
@@ -22,6 +23,8 @@ Install the following NuGet packages:
2223
* `Microsoft.AspNetCore.Authentication.Cookies`
2324
* `Microsoft.EntityFrameworkCore.SqlServer`
2425

26+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
27+
2528
In `Startup.cs`, update the `Startup.ConfigureServices` method to use Entity Framework and Identity services:
2629

2730
```csharp

aspnetcore/migration/proper-to-2x/membership-to-core-identity.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ author: isaacrlevin
44
description: Learn how to migrate existing ASP.NET apps using Membership authentication to ASP.NET Core 2.0 Identity.
55
ms.author: wpickett
66
ms.custom: mvc
7-
ms.date: 01/10/2019
7+
ms.date: 10/29/2024
88
uid: migration/proper-to-2x/membership-to-core-identity
99
---
10+
<!-- ms.sfi.ropc: t -->
1011
# Migrate from ASP.NET Membership authentication to ASP.NET Core 2.0 Identity
1112

1213
By [Isaac Levin](https://isaaclevin.com)
@@ -49,6 +50,8 @@ The fastest way to view the schema for ASP.NET Core 2.0 Identity is to create a
4950
}
5051
```
5152

53+
[!INCLUDE [managed-identities](~/includes/managed-identities-conn-strings.md)]
54+
5255
1. Select **View** > **SQL Server Object Explorer**. Expand the node corresponding to the database name specified in the `ConnectionStrings:DefaultConnection` property of `appsettings.json`.
5356

5457
The `Update-Database` command created the database specified with the schema and any data needed for app initialization. The following image depicts the table structure that's created with the preceding steps.

aspnetcore/security/app-secrets.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ description: Learn how to store and retrieve sensitive information during the de
55
ms.author: tdykstra
66
monikerRange: '>= aspnetcore-3.0'
77
ms.custom: mvc
8-
ms.date: 02/23/2024
8+
ms.date: 10/29/2024
99
uid: security/app-secrets
1010
---
11+
<!-- ms.sfi.ropc: t -->
1112
# Safe storage of app secrets in development in ASP.NET Core
1213

1314
[!INCLUDE[](~/includes/not-latest-version.md)]

aspnetcore/security/app-secrets/includes/app-secrets-3-5.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
:::moniker range="< aspnetcore-6.0"
2+
<!-- ms.sfi.ropc: t -->
23

34
By [Rick Anderson](https://twitter.com/RickAndMSFT), [Kirk Larkin](https://twitter.com/serpent5), [Daniel Roth](https://github.com/danroth27), and [Scott Addie](https://github.com/scottaddie)
45

56
[View or download sample code](https://github.com/dotnet/AspNetCore.Docs/tree/main/aspnetcore/security/app-secrets/samples) ([how to download](xref:index#how-to-download-a-sample))
67

7-
This document explains how to manage sensitive data for an ASP.NET Core app on a development machine. Never store passwords or other sensitive data in source code. Production secrets shouldn't be used for development or test. Secrets shouldn't be deployed with the app. Instead, production secrets should be accessed through a controlled means like environment variables or Azure Key Vault. You can store and protect Azure test and production secrets with the [Azure Key Vault configuration provider](xref:security/key-vault-configuration).
8+
This article explains how to manage sensitive data for an ASP.NET Core app on a development machine. Never store passwords or other sensitive data in source code or configuration files. Production secrets shouldn't be used for development or test. Secrets shouldn't be deployed with the app. Production secrets should be accessed through a controlled means like Azure Key Vault. Azure test and production secrets can be stored and protected with the [Azure Key Vault configuration provider](xref:security/key-vault-configuration).
89

10+
For more information on authentication for test and production environments, see [Secure authentication flows](xref:security/index#secure-authentication-flows).
911
## Environment variables
1012

1113
Environment variables are used to avoid storage of app secrets in code or in local configuration files. Environment variables override configuration values for all previously specified configuration sources.

0 commit comments

Comments
 (0)