private async Task <IReadOnlyList <IAccount> > GetAccountsInternalAsync(string clientID, string redirectUri) { BrokerRequest brokerRequest = new BrokerRequest() { ClientId = clientID, RedirectUri = new Uri(redirectUri) }; try { await InitiateBrokerHandShakeAsync().ConfigureAwait(false); var accountData = await GetBrokerAccountDataAsync(brokerRequest).ConfigureAwait(false); return(_brokerHelper.ExtractBrokerAccountsFromAccountData(accountData)); } catch (Exception ex) { _logger.Error("[Android broker] Failed to get accounts from the broker. "); _brokerHelper.HandleBrokerOperationError(ex); throw; } }
public async Task <IReadOnlyList <IAccount> > GetAccountsAsync( string clientId, string redirectUri, AuthorityInfo authorityInfo, ICacheSessionManager cacheSessionManager, IInstanceDiscoveryManager instanceDiscoveryManager) { using (_logger.LogMethodDuration()) { if (!IsBrokerInstalledAndInvokable()) { _logger.Warning("[Android broker] Broker is either not installed or is not reachable so no accounts will be returned. "); return(new List <IAccount>()); } BrokerRequest brokerRequest = new BrokerRequest() { ClientId = clientId, RedirectUri = new Uri(redirectUri) }; try { await InitiateBrokerHandshakeAsync().ConfigureAwait(false); var accounts = GetBrokerAccounts(brokerRequest); return(_brokerHelper.ExtractBrokerAccountsFromAccountData(accounts)); } catch (Exception ex) { _logger.Error("[Android broker] Failed to get Android broker accounts from the broker. "); _brokerHelper.HandleBrokerOperationError(ex); throw; } } }