1
votes

I have obtained an access token from https://login.microsoftonline.com/tenentid/oauth2/token - using the grant_type=client_credentials

Now, when I try to get the embedded token from https://api.powerbi.com/v1.0/myorg/groups/gid/reports/rid/GenerateToken it always returns 401 unauthorized.

Does anyone have any idea why it is like this?

1

1 Answers

0
votes

Make sure you are authenticating against PowerBI audience, you can see it in the decoding of the token in the 'aud' property.

401 (Unauthorized) suggests a bad authority issuing tokens, or a conflict of permissions. Make sure you have a 'Bearer XXX' token where XXX is your access token.

Also make sure you have the right group & report ids (it tends to happen :) )