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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Robert4049
Frequent Visitor

API that uses OAuth 2.0 for authentication

Hey Everyone,

I'm trying to use an API that uses OAuth 2.0 for authentication; the problem lies in the fact that there's no Session Token and it requires my credentials to log into the app; I've managed to capture some session tokens, but they do expire. I'm not really sure what to do here?

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@Robert4049,

You can take a look at the following example about how to connect to API using OAuth 2.0 in Power BI.

http://angryanalyticsblog.azurewebsites.net/index.php/2016/05/16/api-strategies-with-power-bi/

Alternatively, you can create  custom data connector for your data source in Power BI following the guide in this article. And you can check OAuth authentication here.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I've followed this example to get an OAuth token, add it to the header in a call to our API service, and have it working from Power BI Desktop.  However, I can't seem to configure automated refresh from the Power BI service portal for this data source.  I recieve the message "Your data source can't be refreshed because the credentials are invalid. Please update your credentials and try again."  How do I configure automated refresh for a data source based on this approach to authentication?  Any help is appreciated, this is a pretty big road block if we can't get it working.

@amiller,

Please check my reply in the following thread.

https://community.powerbi.com/t5/Integrations-with-Files-and/How-to-refresh-ODATA-API-with-OAuth2/td...

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors