public async Task <IWebTokenRequestResultWrapper> RequestTokenForWindowAsync(
            IntPtr _parentHandle,
            WebTokenRequest webTokenRequest,
            WebAccount wamAccount)
        {
            using (_logger.LogBlockDuration("WAM:RequestTokenForWindowAsync:"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                    _logger.VerbosePii(wamAccount.ToLogString(true), wamAccount.ToLogString(false));
                }
#if WINDOWS_APP
                // UWP requires being on the UI thread
                await _synchronizationContext;

                WebTokenRequestResult wamResult = await WebAuthenticationCoreManager.RequestTokenAsync(
                    webTokenRequest,
                    wamAccount);
#else
                var wamResult = await WebAuthenticationCoreManagerInterop.RequestTokenWithWebAccountForWindowAsync(
                    _parentHandle, webTokenRequest, wamAccount);
#endif
                return(new WebTokenRequestResultWrapper(wamResult));
            }
        }
        public async Task <IWebTokenRequestResultWrapper> GetTokenSilentlyAsync(WebAccount webAccount, WebTokenRequest webTokenRequest)
        {
            using (_logger.LogBlockDuration("WAM:GetTokenSilentlyAsync:webAccount"))
            {
                if (_logger.IsLoggingEnabled(LogLevel.Verbose))
                {
                    _logger.VerbosePii(webTokenRequest.ToLogString(true), webTokenRequest.ToLogString(false));
                    _logger.VerbosePii(webAccount.ToLogString(true), webAccount.ToLogString(false));
                }

                var wamResult = await WebAuthenticationCoreManager.GetTokenSilentlyAsync(webTokenRequest, webAccount);

                return(new WebTokenRequestResultWrapper(wamResult));
            }
        }