Skip to content

Configuring the DataProtection options via appsettings.json file #45942

Open
@joymon

Description

@joymon

Summary

Currently, it seems the DataProtection settings need to be configured via code. We are looking for support via appsettings.json or in general via configuration without recompiling the application for different deployment environment types.

Motivation and goals

As developers, we would like to code once and deploy in various environment types by tuning the configuration. Currently, the DataProtection configuration seems to support only via code. Though we can read configuration in a custom way, it would be great if the library provides the configuration options out of box.

In scope

Configure the DataProtection options from appsettings.json. In code, we will be adding services.AddDataProtection();

Out of scope

Risks / unknowns

How might developers misinterpret/misuse this? How might implementing it restrict us from other enhancements in the future? Also list any perf/security/correctness concerns.

Examples

services.AddDataProtection() - This will be loading the settings from the appsettings.json before defaulting to the values in the code.

ex: By default, the keys are stores at %USERPROFILE%\AppData\Local\ASP.NET\DataProtection-Keys. To change this folder we have to write code. This path should be configurable via appsettings.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-dataprotectionIncludes: DataProtectiondesign-proposalThis issue represents a design proposal for a different issue, linked in the description

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions