title: Catch Asp .Net Identity with .Net core on IIS from regular ASP.NET MVC
body: <p>I deployed an ASP.NET Core Web application on IIS, so far everything is ok. I  have another ASP.NET MVC application that is using ASP.NET Identity and  injecting a cookie <code>AspNet.ApplicationCookie</code> to the browser and afterwards redirecting me to my .Net Core app.</p>
  <p>What I need to do is to get this user that was originally inserted on ASP.NET MVC on my .NET Core application and get asp identity authorized from my previous app, both apps have same domain so I can see the cookie in storage.</p>
  <p>Question is: how can I configure the .NET Core app that its could get authenticated by ASP.NET cookie from previous application, also the ASP.NET MVC app is a blackbox for me.</p>
  <p>This is what I tried so far:</p>
  <pre><code>services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
          .AddIdentityCookies(); 
  app.UseAuthentication();
  </code></pre>
  <p>Update:</p>
  <p>This is what i added to my code, but still doesn't get my previous identity
  also i got some unfamilliar execeptions</p>
  <pre><code>services.AddAuthentication(option=&gt; {
          new CookieAuthenticationOptions { Cookie = {
  
             Domain = &quot;.dev.*****.ru&quot;,
             Path =&quot;/&quot;,
             Name= &quot;.AspNet.ApplicationCookie&quot;,
              }
          };
      }).AddIdentityCookies(option=&gt;new CookieAuthenticationOptions
      {
          Cookie = {
             Domain = &quot;.dev.*****.ru&quot;,
             Path =&quot;/&quot;,
             Name= &quot;.AspNet.ApplicationCookie&quot;,
          }
      });
  </code></pre>
  <p>[2019-04-12 11:25:51.903 +03:00 WRN] Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository
  Using an in-memory repository. Keys will not be persisted to storage.</p>
  <p>[2019-04-12 11:25:51.943 +03:00 WRN] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
  Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.</p>
  <p>[2019-04-12 11:25:51.977 +03:00 WRN] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
  No XML encryptor configured. Key &quot;41c89830-2ef1-48f7-afa5-16680973e6f2&quot; may be persisted to storage in unencrypted form.</p>