/// <summary> /// This method is only used for Silent authentication requests so that we can check to see if an account exists in the account manager before /// sending the silent request to the broker. /// </summary> private BrokerRequest UpdateRequestWithAccountInfo(BrokerRequest brokerRequest) { var accounts = GetBrokerAccounts(brokerRequest); if (string.IsNullOrEmpty(accounts)) { _logger.Info("[Android broker] Android account manager didn't return any accounts. "); throw new MsalUiRequiredException(MsalError.NoAndroidBrokerAccountFound, MsalErrorMessage.NoAndroidBrokerAccountFound); } return(_brokerHelper.UpdateBrokerRequestWithAccountData(accounts, brokerRequest)); }
private async Task <MsalTokenResponse> AcquireTokenSilentViaBrokerAsync(BrokerRequest brokerRequest) { using (_logger.LogMethodDuration()) { _logger.Verbose("[Android broker] User is specified for silent token request. Starting silent request. "); var accountData = await GetBrokerAccountDataAsync(brokerRequest).ConfigureAwait(false); brokerRequest = _brokerHelper.UpdateBrokerRequestWithAccountData(accountData, brokerRequest); string silentResult = await AcquireTokenSilentFromBrokerInternalAsync(brokerRequest).ConfigureAwait(false); return(_brokerHelper.HandleSilentAuthenticationResult(silentResult, brokerRequest.CorrelationId)); } }