title: Multiple Identities in ASP.NET Core 2.0
body: <p>I am migrating an ASP.NET Core 1.0 application to ASP.NET Core 2.0.</p>
  
  <p>In my startup I am configuring two identities:</p>
  
  <pre><code>services.AddIdentity&lt;IdentityUser, IdentityRole&gt;(configureIdentity)
     .AddDefaultTokenProviders()
     .AddUserStore&lt;IdentityUserStore&lt;IdentityUser&gt;&gt;()
     .AddRoleStore&lt;IdentityRoleStore&lt;IdentityRole&gt;&gt;();
  
  services.AddIdentity&lt;Customer, CustomerRole&gt;(configureIdentity)
     .AddDefaultTokenProviders()
     .AddErrorDescriber&lt;CustomerIdentityErrorDescriber&gt;()
     .AddUserStore&lt;CustomerStore&lt;Customer&gt;&gt;()
     .AddRoleStore&lt;CustomerRoleStore&lt;CustomerRole&gt;&gt;();
  </code></pre>
  
  <p>This worked fine in ASP.NET Core 1.0 but fails with the error: <em>System.InvalidOperationException: 'Scheme already exists: Identity.Application'</em> in ASP.NET Core 2.0.</p>
  
  <p>In ASP.NET Core 2.0, if I remove one of the calls to <code>AddIdentity</code> the error goes away. How do I migrate my code so that I can use two different types of identity user and role in my application? Or did I just make a fundamental error in understanding how things work back when I wrote this in ASP.NET Core 1.0?</p>