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> RequestTokenForWindowAsync( IntPtr _parentHandle, WebTokenRequest webTokenRequest, WebAccount wamAccount) { #if WINDOWS_APP WebTokenRequestResult wamResult = await WebAuthenticationCoreManager.RequestTokenAsync( webTokenRequest, wamAccount); #else var wamResult = await WebAuthenticationCoreManagerInterop.RequestTokenWithWebAccountForWindowAsync( _parentHandle, webTokenRequest, wamAccount); #endif return(new WebTokenRequestResultWrapper(wamResult)); }