Forum Discussion

dottorp's avatar
dottorp
Frequent Visitor
8 years ago
Solved

Token acquisition ends with "Unauthorized"

I'm trying to embed a PBI report in a Web app.

I configured the App as "native app", and then granted authorizations you can see in these screenshots:

I'm using this sample: https://github.com/Microsoft/PowerBI-Developer-Samples/
(App Owns data). Now I'm receiving the "Unauthorized" (401) error. What am I missing?

 

  • Solved by myself. I was trying to get a report from "Personal workspace" (I don't know if this is his name in english, I use it in italian), and this was the error. By creating a new workspace area it went all fine.

4 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    dottorp

    Which line in the code throws the exception? Can you debug and send the access token in your case in private message? Also ensure the groupid is correct and the account used is the admin of the workspace group.

    • dottorp's avatar
      dottorp
      Frequent Visitor

      The line is this:

      var reports = await client.Reports.GetReportsInGroupAsync(GroupId);

      I took the value for GroupId here:

       

       

       

      • dottorp's avatar
        dottorp
        Frequent Visitor

        Solved by myself. I was trying to get a report from "Personal workspace" (I don't know if this is his name in english, I use it in italian), and this was the error. By creating a new workspace area it went all fine.