title: Implementing custom key repository in dotnet core 2.0
body: <p>To manage DataProtection for Cookies in dotnet core 1.1, one recommended approach was to implement IXmlRepository as a custom key storage provider and wired it up as follows in Startup.cs:</p>
  
  <pre><code>services.AddSingleton&lt;IXmlRepository&gt;(new MyCustomXmlRepository());
  </code></pre>
  
  <p>After upgrading to dotnet core 2.0, <code>GetAllElements()</code> is no longer called on my repository and <code>HttpContext.User.Identity.IsAuthenticated</code> is always false.</p>
  
  <p>The docs were always vague (<a href="https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/implementation/key-storage-providers</a>) but still imply at the bottom that this approach is still valid.</p>
  
  <p>What am I missing?</p>