Forum Discussion

pedrosilvacreit's avatar
pedrosilvacreit
Regular Visitor
1 year ago

Error 403 "User is not authorized" returned when calling GenerateTokenInGroup Power BI API

Hello.

 

I'm trying to use service principal to authenticate an Entra ID app, to then generate a token to use to embed a Power BI report. I've followed the steps in this link, register the app, without permission has the advice, created the security group, enabled the Power BI service admin settings and added service principal to the workspace. The call to acquire the client token is successful and returns an access token. This is a screenshot of the parameters (I've omitted the sensitive data):

However, using the access token returned in the GenerateTokenInGroup request, is returning a 403 error response, with this message: 

{
    "error": {
        "code": "Unauthorized",
        "message": "User is not authorized"
    }
}

I've seen a lot of documentation, but I still haven't understood the issue. I've read somewhere that service principal authentication might not work with GenerateTokenInGroup, but found no definitive answer or an alternative solution. The documentation available is not very clear and misses important points. 

 

Any help would be greatly appreciated.

 

Thank you. 

3 Replies