Forum Discussion
How to refresh using REST API with OAuth2
- 10 years ago
Hi,
As you guessed, refreshing data with OAuth2 authentication is not yet supported in Power BI. Editing credentials in the PowerBI.com service will require the service to know how to direct you to the OAuth login page, capture and store the access token credentials from the redirect URL and refresh the token when necessary, none of which the service know how to do today with the tooling available to you.
It seems like you have been trying to work around some of those things by writing your custom code, but it might be really hard to have a working end to end solution that way.
The good news is that this is something on the team's radar and is in the pipeline. No solid dates or ETAs at the moment, but expect to hear more announcements in this area in the future.
I'm hoping this may be of use - I had ocassion to get data for a customer from the graph API on the Azure B2C service and I needed to use Oauth 2.0 to authenticate to get this data.
I achieved this by using a simple azure function the take a clientID and secret and perform the OAuth get token and submit token in the azure function - so a single http call to the function gets the graph api data protected by Oauth 2.0.
The code is in Node.js which is natively supported in azure functions and I guess you could host it elsewhere if you required.
See https://github.com/djburnham/graph-api-azure-fn-proxy for the code.
I hope this helps.
Kind regards,
David.
BTW I included my voice in the requests to the dev team to include this functionality in the PowerBi product.
Any news to make it easier to work with a broader variety of REST APIs? Everyone seems to be deprecating simple API key authentication and moving to more complicated Oauth schemes. We need something that works out of the box in PBI.
- efeurich7 years ago
Helper I
Hello,
It is now 8th of January 2019. The last post was 12-11-2017.
iIs it already possible to do this?
Can you refresh using a REST API with OAuth2 in Power BI?