internal override async Task <AuthenticationResult> ExecuteAsync(CancellationToken cancellationToken) { await ResolveAuthorityEndpointsAsync().ConfigureAwait(false); await AcquireAuthorizationAsync(cancellationToken).ConfigureAwait(false); VerifyAuthorizationResult(); if (AuthenticationRequestParameters.IsBrokerEnabled) { var brokerInteractiveRequest = new BrokerInteractiveRequest( AuthenticationRequestParameters, _interactiveParameters, ServiceBundle, _authorizationResult); if (brokerInteractiveRequest.IsBrokerInvocationRequired()) { _msalTokenResponse = await brokerInteractiveRequest.SendTokenRequestToBrokerAsync().ConfigureAwait(false); } } else { _msalTokenResponse = await SendTokenRequestAsync(GetBodyParameters(), cancellationToken).ConfigureAwait(false); } return(await CacheTokenResponseAndCreateAuthenticationResultAsync(_msalTokenResponse).ConfigureAwait(false)); }
private async Task <MsalTokenResponse> ExecuteBrokerAsync(CancellationToken cancellationToken) { IBroker broker = base.ServiceBundle.PlatformProxy.CreateBroker(); var brokerInteractiveRequest = new BrokerInteractiveRequest( AuthenticationRequestParameters, _interactiveParameters, ServiceBundle, _authorizationResult, broker); return(await brokerInteractiveRequest.SendTokenRequestToBrokerAsync().ConfigureAwait(false)); }