Forum Discussion

PMC_PowerBI's avatar
PMC_PowerBI
New Member
1 year ago
Solved

Got invalid accesstoken in postman

Hii 

I am using push data set REST API to push data in every 5 secs. While I am fetching accesstoken using graphAPIs I got 200 response body with a bearer accesstoken but the accesstoken is not valid. Because using that accesstoken I am not able to handle any rest APIs of powerBI.

 

To verify that I visited to the powerBI restAPI lists where all the APIs are got stored and user able to perform actions for getting knowledge like how the rest APIs are working. Link - Push Datasets - Datasets GetTables - REST API (Power BI Power BI REST APIs) | Microsoft Learn.

I login on this server and I got one bearer accesstoken which seems correct.

 

Now to see the defference between those 2 accesstoken I have just decoded it using https://jwt.io/

After decode I got so many mismatch values like "scp" which is known as scope is not present in the accesstoken that I have got from postman and I think that's why I am not able to handle any rest apis of powerBI. But using auto-generated accesstoken I am able to handle the rest APIs.

 

Please let me what is the wrong thing I am doing else is there any setting of something else I missed.

7 Replies

  • You already found the root cause - the missing scope.  Redo your app registration.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi PMC_PowerBI 

     

    Did lbendlin 's method solve your problem? If so, could you please accept it as a solution? This will help more users who are facing the same or similar difficulties. Thank you!

     

    Best Regards,
    Yulia Xu

  • Hii lbendlin , I have redo my application with correct scopes, but still I am not able to get correct accesstoken with scp . Please help me out.

    I have attached a screenshot of the scopes I have provided. Let me know if I miss something.

  • Hii lbendlin , I have redo my application with correct scopes, but still I am not able to get correct accesstoken with scp . Please help me out.

    I have attached a screenshot of the scopes I have provided. Let me know if I miss something.

    • lbendlin's avatar
      lbendlin
      Icon for Super User rankSuper User

      As I understand it Delegated is the wrong type.

      • PMC_PowerBI's avatar
        PMC_PowerBI
        New Member

        HIi lbendlin , can you please tell what are permissions should required here. If not delegated then which type of permission are required here please?