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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Power Query SDK is crashing after try to login again for OAuth v2 in Unit testing

Hello, I'm trying to run the unit tests, a have a couple of functions are calling to an API that require authentication.

The first time is OK, I authenticate (MyConnector.Contents() ). but then the Error message tab comes up again to request the authentication for another endpoint (MyConnector.AnotherFunction()).

Screen Shot 2020-08-11 at 1.03.39 PM.png

 When I try to login again, Visual Studio crash.

 

Screen Shot 2020-08-11 at 1.08.06 PM.png

 

I'm doing something wrong? 

 

 

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

From the screenshot, it seems your custom connector doesn't define the proper authentication type, please follow a clear guide how to implement Oauth2 authentication type for custom connector:

https://jussiroine.com/2019/02/building-a-custom-connector-for-power-bi-that-supports-oauth2-to-visualize-my-wellness-data/

 

Best Regards

Maggie

Anonymous
Not applicable

Thank you @v-juanli-msft 

 

I already have my connector working with oauth authentication, but the problem is when I'm running the unit testing in the *.query.pq file. 

I'm trying to consume an OAuth2 API, however, at a certain stage a Pop-Up opens asking for Login and Password on the page. Is it possible to login with Power Query?

From the screenshot it appears your data source kind is showing up as "Web", rather than your custom connector. This likely means that you're trying to call Web.Contents outside of your custom data source function. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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