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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
carlosmunoz
Microsoft Employee
Microsoft Employee

Authentication error with API v2

We have Power BI embedded reports in a .NET web application running on framework 4.5.2 and with Power BI API 2.4

Since yesterday those reports start to failed. The error is in the authentication process with the API, specifically on this line:

 

var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, ClientId, credential);

 

The error is not giving much information: "The underlying connection was closed: An unexpected error occurred on a send."

 

I tried to setup a project with the new API v.3.11.1 and the exact same code is running without any issues, the problem is that we will need to updagrade the whole project to framework 4.7.2 and that could take a considerable effort. Are you aware of any possible workaround to keep using v2 until we succesfully upgrade the project? 

1 REPLY 1
michaelx2
Microsoft Employee
Microsoft Employee

Hello @carlosmunoz ,

The issue is not caused by the new API v.3.11.1. In the next release of the framework the SecurityProtocolType enumerator got extended with the newer Tls protocols, so if your application can use th 4.5 version you can also use Tls11 and Tls12. So if you are on .net framework 4.5,change the SecurityProtocol .

 

 

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | 
                                       SecurityProtocolType.Tls11 |
                                       SecurityProtocolType.Tls12;

 

 

 

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.