Microsoft.PowerBI.Security.PowerBIToken.CreateReportEmbedToken C# (CSharp) Method

CreateReportEmbedToken() public static method

Creates a embed token with default expiration used to embed Power BI components into your own applications
public static CreateReportEmbedToken ( string workspaceCollectionName, string workspaceId, string reportId, System.TimeSpan slidingExpiration, string username = null, IEnumerable roles = null ) : PowerBIToken
workspaceCollectionName string The workspace collection name
workspaceId string The workspace id
reportId string The report id
slidingExpiration System.TimeSpan The timespan to append to the current date/time
username string The RLS username
roles IEnumerable The RLS roles
return PowerBIToken
        public static PowerBIToken CreateReportEmbedToken(string workspaceCollectionName, string workspaceId, string reportId, TimeSpan slidingExpiration, string username = null, IEnumerable<string> roles = null)
        {
            var expires = DateTime.UtcNow.Add(slidingExpiration);
            return CreateReportEmbedToken(workspaceCollectionName, workspaceId, reportId, expires, username, roles);
        }

Same methods

PowerBIToken::CreateReportEmbedToken ( string workspaceCollectionName, string workspaceId, string reportId, System.DateTime expiration, string username = null, IEnumerable roles = null ) : PowerBIToken
PowerBIToken::CreateReportEmbedToken ( string workspaceCollectionName, string workspaceId, string reportId, string username = null, IEnumerable roles = null ) : PowerBIToken