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
Haderach
Frequent Visitor

Expiration information about AccessToken generated with PowerBI Rest API

Hello,

 

We are developping an Delphi winform application which is reading powerBI report in TWebBrowser.

To call reports, we are reading AccessToken in an INI file previously generated with the ClientID created here : https://dev.powerbi.com/apps 

 

The AccessToken is generated with a C# console application with this code :(because we did not find any other solution to generated it in Delphi)

string redirectUri = "https://login.live.com/oauth20_desktop.srf";
string resourceUri = "https://analysis.windows.net/powerbi/api";
string authorityUri = "https://login.windows.net/common/oauth2/authorize";
AuthenticationContext authContext = new AuthenticationContext(authorityUri);
string token = authContext.AcquireToken(resourceUri, clientID, new Uri(redirectUri)).AccessToken;

When the user is running our application, he have to login with his powerBI account but we don't understand how many time the AcessToken is valid. Is there an expiration ? How can we set it ?

 

Thank you for your help.

1 ACCEPTED SOLUTION
Eric_Zhang
Microsoft Employee
Microsoft Employee

@Haderach

Normally the token expires in one hour. You can decode the token and find an "exp" field in the decoded JSON.

 

As to how to extend the expire duration, it is a more Azure AD question. I think you'll get more proper response from the dedicated Azure AD forum.

View solution in original post

1 REPLY 1
Eric_Zhang
Microsoft Employee
Microsoft Employee

@Haderach

Normally the token expires in one hour. You can decode the token and find an "exp" field in the decoded JSON.

 

As to how to extend the expire duration, it is a more Azure AD question. I think you'll get more proper response from the dedicated Azure AD forum.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.