Store credentials in ASP.NET 5 application

The old hands among us still come from a time when you stored sensitive information like passwords and access keys in app.config, web.config or later in appsettings.json.

Fortunately, this has changed in recent years and it has become much easier to store trustworthy information.

The following example shows how easy it has become with the latest versions of ASP.NET to accomplish this and is aimed primarily at newcomers.

You can find a full working copy here