示例#1
0
        private async void AuthenticatCredentials(string name, string passphrase)
        {
            AuthenticateHandler auth = new AuthenticateHandler();

            auth.Name     = name;
            auth.Password = passphrase;

            string response = auth.Validate();

            if (response.Contains("The user"))
            {
                await main.ShowMessageAsync("Non-existant User", response);
            }
            else if (response.Contains("Incorrect"))
            {
                await main.ShowMessageAsync("Incorrect Password", response);
            }
            else
            {
                await main.ShowMessageAsync("Successful login", response);

                string token = auth.RetrieveAccessToken();
                SuccessfulLoginAsync(token);
            }
        }