{"action":"created","issue":{"url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5","labels_url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5/comments","events_url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5/events","html_url":"https://github.com/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5","id":40329404,"number":5,"title":"MultitenantUserStore.FindByEmailAsync doesn't take tenantId into consideration","user":{"login":"kether667","id":5508938,"avatar_url":"https://avatars.githubusercontent.com/u/5508938?v=3","gravatar_id":"","url":"https://api.github.com/users/kether667","html_url":"https://github.com/kether667","followers_url":"https://api.github.com/users/kether667/followers","following_url":"https://api.github.com/users/kether667/following{/other_user}","gists_url":"https://api.github.com/users/kether667/gists{/gist_id}","starred_url":"https://api.github.com/users/kether667/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kether667/subscriptions","organizations_url":"https://api.github.com/users/kether667/orgs","repos_url":"https://api.github.com/users/kether667/repos","events_url":"https://api.github.com/users/kether667/events{/privacy}","received_events_url":"https://api.github.com/users/kether667/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-08-15T07:41:30Z","updated_at":"2015-03-25T14:19:14Z","closed_at":null,"body":"TenantId is not taken into consideration when using with RequireUniqueEmail = true on UserValidator\r\n\r\n            manager.UserValidator = new UserValidator<ApplicationUser>(manager)\r\n            {\r\n                AllowOnlyAlphanumericUserNames = false,\r\n                RequireUniqueEmail = false\r\n            };\r\n\r\n\r\nRoot cause is that IUserEmailStore doesn't mark FindByEmailAsync as virtual and since MultitenantUserStore extends default UserStore which doesn't know anything about tenantId it cannot work properly.\r\n\r\nSolution is to copy&paste UserStore<TUser, TRole, TKey, TUserLogin, TUserRole, TUserClaim> into and modify IUserEmailStore.FindByEmailAsync implementation... \r\n\r\nor make MS mark FindByEmailAsync as virtual\r\n"},"comment":{"url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/comments/86047045","html_url":"https://github.com/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5#issuecomment-86047045","issue_url":"https://api.github.com/repos/JSkimming/AspNet.Identity.EntityFramework.Multitenant/issues/5","id":86047045,"user":{"login":"rikkreeftenberg","id":5695268,"avatar_url":"https://avatars.githubusercontent.com/u/5695268?v=3","gravatar_id":"","url":"https://api.github.com/users/rikkreeftenberg","html_url":"https://github.com/rikkreeftenberg","followers_url":"https://api.github.com/users/rikkreeftenberg/followers","following_url":"https://api.github.com/users/rikkreeftenberg/following{/other_user}","gists_url":"https://api.github.com/users/rikkreeftenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/rikkreeftenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rikkreeftenberg/subscriptions","organizations_url":"https://api.github.com/users/rikkreeftenberg/orgs","repos_url":"https://api.github.com/users/rikkreeftenberg/repos","events_url":"https://api.github.com/users/rikkreeftenberg/events{/privacy}","received_events_url":"https://api.github.com/users/rikkreeftenberg/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T14:19:14Z","updated_at":"2015-03-25T14:19:14Z","body":"Hi James,\r\n\r\nI was wondering if you could add the MultitenantUserStore.FindByEmailAsync:\r\n\r\n        public override Task<TUser> FindByEmailAsync(string email)\r\n        {\r\n            if (string.IsNullOrWhiteSpace(email))\r\n                throw new ArgumentNullException(\"email\");\r\n\r\n            ThrowIfInvalid();\r\n\r\n            return Users.Where(u => u.Email == email && u.TenantId.Equals(TenantId)).FirstOrDefaultAsync();\r\n        }\r\n\r\n\r\nSince the Microsoft ASP.NET Identity Entityframeword version 2.2 is released, you can push the new Multitenant Library to Nuget. \r\nI'm using the library in a production system and I'm very glad with it!\r\n\r\nSo thank you for your effort.\r\n\r\nRegards,\r\n\r\nRik"}}