{"action":"opened","issue":{"url":"https://api.github.com/repos/IdentityServer/IdentityServer3.AspNetIdentity/issues/58","labels_url":"https://api.github.com/repos/IdentityServer/IdentityServer3.AspNetIdentity/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/IdentityServer/IdentityServer3.AspNetIdentity/issues/58/comments","events_url":"https://api.github.com/repos/IdentityServer/IdentityServer3.AspNetIdentity/issues/58/events","html_url":"https://github.com/IdentityServer/IdentityServer3.AspNetIdentity/issues/58","id":123871823,"number":58,"title":"How to Import Existing Membership Data into IdentityServer3.AspNetIdentity Tables","user":{"login":"farzad99","id":16258460,"avatar_url":"https://avatars.githubusercontent.com/u/16258460?v=3","gravatar_id":"","url":"https://api.github.com/users/farzad99","html_url":"https://github.com/farzad99","followers_url":"https://api.github.com/users/farzad99/followers","following_url":"https://api.github.com/users/farzad99/following{/other_user}","gists_url":"https://api.github.com/users/farzad99/gists{/gist_id}","starred_url":"https://api.github.com/users/farzad99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farzad99/subscriptions","organizations_url":"https://api.github.com/users/farzad99/orgs","repos_url":"https://api.github.com/users/farzad99/repos","events_url":"https://api.github.com/users/farzad99/events{/privacy}","received_events_url":"https://api.github.com/users/farzad99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-25T10:24:51Z","updated_at":"2015-12-25T10:24:51Z","closed_at":null,"body":"I have a script that moves membership table users to identity tables. The part that imports user's password into the AspNetUsers.PasswordHash column is as follows:\r\n\r\nINSERT INTO AspNetUsers\r\n(\r\n...\r\n [PasswordHash],\r\n ...\r\nSELECT \r\n ...\r\n (aspnet_Membership.Password+'|'+CAST(aspnet_Membership.PasswordFormat as varchar)+'|'+aspnet_Membership.PasswordSalt),\r\n ...\r\n\r\nTo give you an example for one user I did:\r\n\r\ninsert into [IdentityServer3.AspNetIdentity].[dbo].[AspNetUsers] \r\n  (Id, PasswordHash, SecurityStamp, UserName, EmailConfirmed, PhoneNumberConfirmed, TwoFactorEnabled, LockoutEnabled, AccessFailedCount) values\r\n  ('824B3B74-909A-4CD5-A7B3-C1243142C398', \r\n  'JKPDfgg/63IBjIf0EC4Pm5WRe90=' + '|' + CAST(1 as varchar) + '|'+ 'eembO/PkE9C4gXBqSX20Yg==' ,\r\n  NEWID(),\r\n  'oo7',\r\n  0, 0, 0, 0, 0);\r\n\r\nWhen I use a regular MVC project that uses local accounts security I'm able to authenticate users from the Identity tables that have the imported data. But when I do the same in the AspNetIdentity sample that's part of the IdentityServer3 samples it doesn't work and throws an exception. I looked at the log file and it says:\r\n...\r\nSystem.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. \r\n   at System.Convert.FromBase64_ComputeResultLength(Char* inputPtr, Int32 inputLength)\r\n   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)\r\n   at System.Convert.FromBase64String(String s)\r\n   at Microsoft.AspNet.Identity.Crypto.VerifyHashedPassword(String hashedPassword, String password)\r\n...\r\n\r\nDoes anybody know what I need to do with existing membership passwords so they can be used in the AspNetIdentity sample? \r\n"}}