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));
            }
        }
コード例 #2
0
        public async Task <IWebTokenRequestResultWrapper> RequestTokenForWindowAsync(
            IntPtr _parentHandle,
            WebTokenRequest webTokenRequest)
        {
#if WINDOWS_APP
            WebTokenRequestResult wamResult = await WebAuthenticationCoreManager.RequestTokenAsync(webTokenRequest);
#else
            var wamResult = await WebAuthenticationCoreManagerInterop.RequestTokenForWindowAsync(
                _parentHandle, webTokenRequest);
#endif
            return(new WebTokenRequestResultWrapper(wamResult));
        }