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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Token received from embedded API does not respect TokenLifetimePolicy that has been set in policies

I require the embed tokens I receieve back from the embedded API to live longer than the defaulted hour. I followed the information here

 

https://docs.microsoft.com/en-gb/azure/active-directory/develop/active-directory-configurable-token-...

 

and set a new policy for "AccessTokenLifetime" with the following

 

 New-AzureADPolicy -Definition @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"23:59:59"}}') -DisplayName "WebPolicyScenario" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"

   

I then assigned this policy to my application using the Add-AzureADApplicationPolicy command.

 

However the tokens I get back still have one hour expiration, is there something I am missing? I have also tried setting MaxAgeSessionSingleFactor, but with no success.

 

Thanks

1 REPLY 1
samsonfr
Frequent Visitor

Hi,

Same here, we tried it with a Service Principal used in our Embed for your Customers scenario but AuthenticationContext -> AcquireTokenAsync never return more than 1 hour in AuthenticationResult.
We are going to at least make sure to get a full hour instead of a random value (there is a token cache) by using this solution: https://community.powerbi.com/t5/Developer/Generate-Token-API-returns-token-with-variable-short-expi...

But did you resolve it any other way?

Thanks,

 

Frederick

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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