Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Custom Connector OAuth2 use WebView2?

My company uses a custom connector to consume an API for one of our services that requires OAuth 2 for authentication.

This service's login page doesn't support Internet Explorer and only works with modern browsers.

 

Previously to get the connector to work I was able to download the Beta version of Edge Chromium, and set a couple of environmental variables to get Power BI Desktop to use Edge for the login popup.

 

 

PQ_EnableEdgeChromiumOAuth = true
PQ_ExtendEdgeChromiumOAuthAllowList = [connector name]

 

 

After one of the recent updates (one of the ones since May) this has stopped working, and now when loading the login page PBI Desktop throws some .NET errors:

 

Microsoft.Mashup.WebViews.WebViewNavigationException: Unknown
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Mashup.Client.UI.WebViews.WebViewOAuthDialog.<<OnWebViewCreated>b__15_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Mashup.Client.UI.WebViews.WebViewOAuthDialog.<HandleAsyncExceptions>d__14.MoveNext()

 

 

When I remove the Environmental Variables the latest version of PBI Desktop still uses the IE based web frame, and not WebView2.

 

Is there any way to force it to use the newer engine with a custom connector? Or any way to get it to work like it used to?  I tried reverting back to an older version of PBI but the instal fails on any that are older than June. I've tried installing the WebView2 framework separately, updating PBI, updating VS 2019, updating .NET versions. All with the same result. 

 

I've also tried contacting Microsoft Support on this one. They basically had a ~1.5 hour meeting with me where they had me clear all my settings and preferences, install / reinstall then apologized for delays for three weeks ultimately saying the support was 'out of scope' and closed the ticket. Hopefully someone here has some ideas?

3 REPLIES 3
Anonymous
Not applicable

I was able to come up with a workaround that isn't the greatest.

 

Basically:

Install mitmproxy

set my workstation to use that proxy

Intercept requests to the api's domain

Login with the auth page in my browser, capture the response with the auth token.

start logging in with power bi, instead of returning the auth page response, replace it with the response from the browser.

 

That got me logged in and  working for now,  and should keep the token refreshed as long as I open the report regularly...

 

Still looking for a proper fix if anyone has one.

Anonymous
Not applicable

Hi @Anonymous ,

I'm sorry that I can't reproduce your problem. Based on your description, it appears that the issue is due to a recent update to the Power BI Desktop version that is causing your custom connector to not work. Please check out the content in these links below, hopefully they will help you and give you some ideas or clues to solve the problem.

CONNECTION ISSUE

Building a custom connector for Power BI that supports OAuth2 to visualize my wellness data

underlying connection was closed: An unexpected error occurred on a send IdevioGeoAnalyticsConnector

Upgrade the TLS version of your Power BI application to TLS 1.2

Best Regards

Anonymous
Not applicable

Sorry,

 

None of the links are a fix for the issue.

 

The first one used to be a fix for the auth page not supporting IE 11, but is what causes the error now. 

The second link just shows how to make a connector with Oauth, which I've already done and the auth flow works fine since it works in the PowerBI service just fine and used to work in desktop. 

 

The third link doesn't really apply as I have .NET 4.6 and am not getting that error.

 

The final link also doesn't apply as I'm not using the Power BI API SDK, as that isn't used for connectors it's used for 3rd party apps to connect through the API.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.