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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

OAuth2 Authentication credentials

Hi Team,
In Power BI report, I was connecting the Dataflow as a data source.

w_Das_1-1736506854938.png

I am using OAuth2 as the authentication method to connect to the Dataflow for scheduled refresh. However, the connection expires after 24 hours, and I have to re-enter the credentials again every day to make the connection successful.
How can I resolve this issue and automate the scheduled refresh without needing to manually re-enter the credentials every day?

Thanks,
w_Das

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Thanks for 3CloudThomas's reply!
And @Anonymous , Based on the screenshot you provided, it seems that you are using Dataflows Gen1. Dataflows Gen1 is about to be deprecated, and when using OAuth2 credentials in Dataflows Gen1, the gateway does not support automatic refresh of tokens when the access token expires.

vjunyantmsft_0-1736735164042.png

https://learn.microsoft.com/en-us/data-integration/gateway/service-gateway-tshoot#limitations-and-considerations 

vjunyantmsft_1-1736735190166.png

https://learn.microsoft.com/en-us/data-integration/gateway/service-gateway-onprem-faq#why-do-i-get-the-errors--invalidconnectioncredentials--or--accessunauthorized--when-accessing-data-sources-using-oauth2-credentials-from-dataflows-gen1-even-though-the-credentials-are-updated-recently--mid-stream-token-refresh-issue-- 

You can refer to the user's answer in this thread:
Re: Oauth2 gateway bugs affecting datasets not dat... - Microsoft Fabric Community

If you don't want to manually update the credentials every time, the best thing to do is to change your dataflow from Gen1 to Gen2.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Thanks for 3CloudThomas's reply!
And @Anonymous , Based on the screenshot you provided, it seems that you are using Dataflows Gen1. Dataflows Gen1 is about to be deprecated, and when using OAuth2 credentials in Dataflows Gen1, the gateway does not support automatic refresh of tokens when the access token expires.

vjunyantmsft_0-1736735164042.png

https://learn.microsoft.com/en-us/data-integration/gateway/service-gateway-tshoot#limitations-and-considerations 

vjunyantmsft_1-1736735190166.png

https://learn.microsoft.com/en-us/data-integration/gateway/service-gateway-onprem-faq#why-do-i-get-the-errors--invalidconnectioncredentials--or--accessunauthorized--when-accessing-data-sources-using-oauth2-credentials-from-dataflows-gen1-even-though-the-credentials-are-updated-recently--mid-stream-token-refresh-issue-- 

You can refer to the user's answer in this thread:
Re: Oauth2 gateway bugs affecting datasets not dat... - Microsoft Fabric Community

If you don't want to manually update the credentials every time, the best thing to do is to change your dataflow from Gen1 to Gen2.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

execute the dataflow 2-3 times a day and see if the authentication sticks. Not running for 24 hours expires the token in your case.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors