Safe storage values can be stored by calling a .NET CLI command. The following command adds the complex password to the key password:
dotnet user-secrets set password P@ssW0rd
You should run the preceding command from the root of your project.
We can access the password by passing the key name of the value stored through the Configuration object:
Var password = Configuration["password"];