public override async Task Execute() { await Authorize(); IPlatformResponse <IAuthorization> result = null; if (SimpleClient?.Authorization?.UserName == Username && SimpleClient?.Authorization?.Password == Password) { result = await SimpleClient.Login(SimpleClient.Authorization); } else { var auth = DIContainer.Current.Resolve <IAuthorization>(); auth.UserName = Username; auth.Password = Password; result = await SimpleClient.Login(auth); } if (!string.IsNullOrEmpty(AuthorizationFile) && result.Success && !string.IsNullOrEmpty(result?.Response?.AccessToken)) { File.WriteAllText(AuthorizationFile, _serialize.SerializeToString(result.Response)); result.Response.Refreshed = false; } Log.Debug(result); UpdateAuthorization(); }