title: How can I use IdentityServer3 External Authentication to login a Local User?
body: <p>Having worked through the IdentityServer3 MVC tutorial <a href="https://identityserver.github.io/Documentation/docsv2/overview/mvcGettingStarted.html" rel="nofollow">here</a> I have a working sample application where I can log in as 'bob', or I can log in with any google account.</p>
  
  <p>What I am trying to work out is, say bob has an additional field 'GoogleId':</p>
  
  <pre><code>public static class Users
  {
      public static List&lt;InMemoryUser&gt; Get()
      {
          new InMemoryUser
          {
              Username = "bob",
              Password = "secret",
              Subject = "1",
              GoogleId = "60a71ff098f6509cbd4fbda2f495eacb",
  
              Claims = new[]
              {
                  new Claim(Constants.ClaimTypes.GivenName, "Bob"),
                  new Claim(Constants.ClaimTypes.FamilyName, "Smith"),
                  new Claim(Constants.ClaimTypes.Role, "Geek"),
                  new Claim(Constants.ClaimTypes.Role, "Foo")
              }
          }
      }
  }
  </code></pre>
  
  <p>When I log in with Google, if the incoming subject claim matches a User's GoogleId, log in with the local user account.</p>
  
  <p>The <a href="https://github.com/IdentityServer/IdentityServer3.AspNetIdentity" rel="nofollow">IdentityServer3.AspNetIdentity project</a> must be doing this as the Asp.Net Identity has external logins keyed off local user accounts. However I can't use the Asp.Net Identity user model as I'm working in a legacy application. I can't understand the code there well enough to apply it to my situation.</p>
  
  <p>Is there a sample or tutorial somewhere that demonstrates this scenario?</p>