Example #1
0
        public Task <bool> CheckLogin(string username, string password)
        {
            var _username = NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString("username"));
            var _password = KeychainHelpers.GetPasswordForUsername(username, "XamarinExpenses", true);

            if (_username == null || _password == null)
            {
                return(Task.FromResult(false));
            }

            if (password == _password &&
                username == _username.ToString())
            {
                return(Task.FromResult(true));
            }

            return(Task.FromResult(false));
        }
Example #2
0
        public Task <bool> CheckLogin(string username, string password)
        {
            var usernameFromKeyChain = NSUserDefaults.StandardUserDefaults.ValueForKey(new NSString(_username));
            var passwordFromKeyChain = KeychainHelpers.GetPasswordForUsername(username, _serviceId, true);

            if (usernameFromKeyChain == null || passwordFromKeyChain == null)
            {
                return(Task.FromResult(false));
            }

            if (password == passwordFromKeyChain.ToString() &&
                username == usernameFromKeyChain.ToString())
            {
                return(Task.FromResult(true));
            }

            return(Task.FromResult(false));
        }