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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
sfkzr
New Member

Custom data connector with expiring refresh_token

The situation is:

I have an initial refreshtoken that I give as input, this returns me a new refreshtoken and accesstoken. The lifetime of the initial refreshtoken is ended after the first request. The accesstoken will be used for the bearer token and this will be used to get data from the other endpoints.

 

In Power BI I connect to my custom data connector with my initial refreshtoken.

sfkzr_0-1630569173258.png

This gives me a preview of the data.

sfkzr_1-1630569173261.png

 

When I click load it executes the data connector again with the initial refreshtoken (that is expired), this results in an error.


Is there a way in to store the new refreshtoken / accesstoken I received in the initial execution, so I can use it afterwards ? Or maybe another solution?

1 REPLY 1
Anonymous
Not applicable

@sfkzr 

 

Please refer to:

https://github.com/Microsoft/DataConnectors

There is no direct code for you in a easy way but maybe you can find a solution: see https://docs.microsoft.com/en-us/power-query/handlingauthentication

 

 

Best Regards
Paul

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.