Forum Discussion
matt_b
3 years agoFrequent Visitor
Embed Token obtained using Profile causing Angular component to not display report properly.
I have built a simple angular app to demonstrate Power BI Embedded, using the "embed for your customers" model, and Microsoft's powerbi-client-angular module. I have a backend project which authe...
Anonymous
3 years agoNot applicable
Hi matt_b ,
403 error stands :
- Bad access token
- Embed type doesn't match token type
GenerateToken can fail, with effective identity supplied, for a few different reasons.
- Dataset doesn't support effective identity
- Username wasn't provided
- Role wasn't provided
- DatasetId wasn't provided
- User doesn't have the correct permissions
To determine the problem, try the following steps:
- Execute get dataset. Is the property IsEffectiveIdentityRequired true?
- Username is mandatory for any EffectiveIdentity.
- If IsEffectiveIdentityRolesRequired is true, Role is required.
- DatasetId is mandatory for any EffectiveIdentity.
- For Analysis Services, the master user has to be a gateway admin.
Please check if it helps.
Best regards.
Community Support Team_ Caitlyn
- matt_b3 years agoFrequent Visitor
Thanks for getting back to me Caitlyn,
I've executed get_dataset as adviced. I can confirm these values:
"isEffectiveIdentityRequired":false,
"isEffectiveIdentityRolesRequired":false,
"isOnPremGatewayRequired":falseI'm not putting any Effective Identity into the token request, which seems correct given those values:
/*
* Get embed token for the report
*/
var tokenRequest = new GenerateTokenRequest(accessLevel: TokenAccessLevel.View, datasetId: powerBIReport.DatasetId.ToString(), allowSaveAs: false);
var embedToken = powerBIClient.Reports.GenerateTokenInGroup(workspaceId, powerBIReport.Id, tokenRequest);However, my problem isn't that GenerateTokenInGroup is failing - I'm successfully getting an embed token, it's just that when using that embed token the angular component is failing to correctly render the report.