title: ASP.Net Identity - AddLogin userId becomes null
body: <p>I use ASP.Net Identity and it works as expected, except when associating an external login provider.</p>
  
  <p>For example, when I call <code>Repository.UserManager.AddLogin()</code> (or Async) I get the exception:</p>
  
  <blockquote>
    <p>The UserId field is required.</p>
  </blockquote>
  
  <p>While debugging I made sure that I was passing the correct <code>userId</code> to the function, I even hardcoded it.</p>
  
  <p>For <code>loginInfo</code> I tried with both Facebook and Google providers.</p>
  
  <p><img src="https://i.stack.imgur.com/RoasF.jpg" alt="enter image description here"></p>
  
  <p>In the watch window we can see that I correctly specified the user ID to the method, and in the Watch window <code>User.Id</code> has the correct value, while <code>userId</code> is <code>null</code>.</p>
  
  <p>Unfortunately the source code is not yet public on Codeplex so I cannot look at the implementation.</p>