Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
When authorizing with a Workspace Collection, I could generate an embed token with an expiry (note the expiry argument):
public static Microsoft.PowerBI.Security.PowerBIToken CreateReportEmbedToken (string workspaceCollectionName, string workspaceId, string reportId, DateTime expiration, string username = null, System.Collections.Generic.IEnumerable<string> roles = null, string scopes = null);
It doesn't appear to be possible with Power BI Embedded:
public static System.Threading.Tasks.Task<Microsoft.PowerBI.Api.V2.Models.EmbedToken> GenerateTokenInGroupAsync (this Microsoft.PowerBI.Api.V2.IReports operations, string groupId, string reportKey, Microsoft.PowerBI.Api.V2.Models.GenerateTokenRequest requestParameters, System.Threading.CancellationToken cancellationToken = null);
Is there any way that I can create a longer-lived embed token?
Hi @Anonymous ,
First of all Workspace Collection is be deprecated.
You couldn't directly control the expiration of the embed token from your code. However you can achieve that by changing overall access token life time in Azure Active Directory.
Reference : https://stackoverflow.com/questions/50486248/power-bi-embedded-app-owns-data-changing-token-expiry
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
1 | |
1 | |
1 |
User | Count |
---|---|
25 | |
3 | |
2 | |
2 | |
2 |