O'Reilly logo

C# 7 and .NET Core Cookbook by Dirk Strauss

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. In the console application, locate the App.config file. This is the file that contains the sensitive data.
  2. If you open the App.config file, you will see that, within the appSettings tag, there is a key added called Secret. This information should probably not be in the App.config to start off with. The problem here is that it might be checked into your source control. Imagine that on GitHub?
        <?xml version="1.0" encoding="utf-8"?>         <configuration>           <startup>              <supportedRuntime version="v4.0" sku=".NETFramework,             Version=v4.6.1"/>           </startup>           <appSettings>             <add key="name" value="Dirk"/>             <add key="lastname" value="Strauss"/>              <add key="Secret" value="letMeIn"/>           </appSettings>         </configuration>
  1. To overcome this vulnerability, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required