{"action":"created","issue":{"url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/149","labels_url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/149/comments","events_url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/149/events","html_url":"https://github.com/trydis/FIFA-Ultimate-Team-Toolkit/issues/149","id":109166153,"number":149,"title":"\"Unable to login\" problem","user":{"login":"sesey","id":5672243,"avatar_url":"https://avatars.githubusercontent.com/u/5672243?v=3","gravatar_id":"","url":"https://api.github.com/users/sesey","html_url":"https://github.com/sesey","followers_url":"https://api.github.com/users/sesey/followers","following_url":"https://api.github.com/users/sesey/following{/other_user}","gists_url":"https://api.github.com/users/sesey/gists{/gist_id}","starred_url":"https://api.github.com/users/sesey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sesey/subscriptions","organizations_url":"https://api.github.com/users/sesey/orgs","repos_url":"https://api.github.com/users/sesey/repos","events_url":"https://api.github.com/users/sesey/events{/privacy}","received_events_url":"https://api.github.com/users/sesey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-30T19:52:49Z","updated_at":"2015-10-01T11:10:09Z","closed_at":null,"body":"Hi\r\nWhere is the problem?\r\n\r\n        private async void button_Click(object sender, RoutedEventArgs e)\r\n        {\r\n            var client = new FutClient();\r\n            LoginResponse response = await Login(client);\r\n        }\r\n        public async Task<LoginResponse> Login(FutClient client)\r\n        {\r\n            var loginDetails = new LoginDetails(\"test@gmail.com\", \"test\", \"test\", Platform.Pc);\r\n            ITwoFactorCodeProvider provider = new ImapTwoFactorCodeProvider(\"test@gmail.com\"\", \"test\", \"imap.googlemail.com\", 993, true);\r\n\r\n            LoginResponse loginResponse = await client.LoginAsync(loginDetails, provider);\r\n            return loginResponse;\r\n        }\r\n       public class ImapTwoFactorCodeProvider : ITwoFactorCodeProvider\r\n       {\r\n        private readonly string _username;\r\n        private readonly string _password;\r\n        private readonly string _hostName;\r\n        private readonly int _port;\r\n        private readonly bool _useUseSsl;\r\n\r\n        public ImapTwoFactorCodeProvider(string username, string password, string hostname, int port, bool useSsl)\r\n        {\r\n            _username = username;\r\n            _password = password;\r\n            _hostName = hostname;\r\n            _port = port;\r\n            _useUseSsl = useSsl;\r\n        }\r\n        public Task<string> GetTwoFactorCodeAsync()\r\n        {\r\n            return Task.Run(async () =>\r\n            {\r\n                var regex = new Regex(@\"((?<=class=\"\"h1\"\">)\\d{6})\");\r\n\r\n                using (var client = new ImapClient(_hostName, _username, _password, AuthMethods.Login, _port, _useUseSsl))\r\n                {\r\n                    for (var i = 0; i < 5; i++)\r\n                    {\r\n                        var messages = client.SearchMessages(SearchCondition.Unseen().And(SearchCondition.From(\"EA\")));\r\n                        foreach (var match in messages.Select(message => regex.Match(message.Value.Body)).Where(match => match.Success))\r\n                        {\r\n                            return match.Value;\r\n                        }\r\n                        await Task.Delay(5000);\r\n                    }\r\n                }\r\n                throw new FutException(\"Unable to find the two-factor authentication code.\");\r\n            });\r\n        }\r\n    }"},"comment":{"url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/comments/144699080","html_url":"https://github.com/trydis/FIFA-Ultimate-Team-Toolkit/issues/149#issuecomment-144699080","issue_url":"https://api.github.com/repos/trydis/FIFA-Ultimate-Team-Toolkit/issues/149","id":144699080,"user":{"login":"Nicorad","id":5977610,"avatar_url":"https://avatars.githubusercontent.com/u/5977610?v=3","gravatar_id":"","url":"https://api.github.com/users/Nicorad","html_url":"https://github.com/Nicorad","followers_url":"https://api.github.com/users/Nicorad/followers","following_url":"https://api.github.com/users/Nicorad/following{/other_user}","gists_url":"https://api.github.com/users/Nicorad/gists{/gist_id}","starred_url":"https://api.github.com/users/Nicorad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nicorad/subscriptions","organizations_url":"https://api.github.com/users/Nicorad/orgs","repos_url":"https://api.github.com/users/Nicorad/repos","events_url":"https://api.github.com/users/Nicorad/events{/privacy}","received_events_url":"https://api.github.com/users/Nicorad/received_events","type":"User","site_admin":false},"created_at":"2015-10-01T11:10:08Z","updated_at":"2015-10-01T11:10:08Z","body":"My bad, you're right, never connected on the PS4 with the account I'm using for test...\r\nEA stops today the \"early access\". @sesey, maybe it's the same problem.\r\nJust tested with the account I use to play, working fine..."}}