Пример #1
0
        static async Task <TokensResponse> AuthenticationMenu(ITesonetApi api)
        {
            TokensResponse        token       = null;
            CredentialsPayload    credentials = null;
            AuthenticationManager authManager = new AuthenticationManager(api);

            while (token == null)
            {
                credentials = UserInterface.AskForCredentials();

                token = await authManager.GetTokenAsync(credentials);

                if (token == null)
                {
                    UserInterface.InformAboutAuthorizationFailure();

                    if (UserInterface.AskIfExit())
                    {
                        break;
                    }
                }
            }

            return(token);
        }
Пример #2
0
 public AuthenticationManager(ITesonetApi api)
 {
     this.api = api;
 }
Пример #3
0
 public ServerManager(ITesonetApi api)
 {
     this.api = api;
 }
Пример #4
0
 public LoginViewModel(ITesonetApi tesonetApi, IEventAggregator eventAggregator)
 {
     _tesonetApi      = tesonetApi;
     _eventAggregator = eventAggregator;
 }