Forum Discussion

BhushanMahajan's avatar
BhushanMahajan
Frequent Visitor
3 years ago

trying to generate embedded token from access token using client credentials but no success .

Hi all ,

i am new to power BI.  I am trying to generate embedded token from access token .

Ref - https://learn.microsoft.com/en-us/answers/questions/750966/scope-used-for-authenticating-to-use-an-app-regist.html

 

Steps  Using Postman -

Scenario 1  -

1] I used  grant type as - ClientCredential  and I obtained access_token.

2] Then i decoded access token using - https://jwt.ms/

3]  scp or scope filed is not available.  I need access of Workspaces and reports .

4]  Hence not able to generate token. Error - Forbidden or unauthorized.

 

 

 

 

 

 

Scenario 2  -

When i used granttype=password , i get access token.

When i decoded it i  can see scp (scope field) .

i can generate embedded token .

 

 

 

Now My Question-

 

Why this difference is there ?

Which scope i should use to generate embedded token ?

i need access of Workspace and reports . But these permissions are not visible under My App  api permissions ?

 

// authenticationResult

= clientApp.AcquireTokenForClient(new String[] { "https://iGrxxxxxxxxx.onmicrosoft.com/edvvvvvvvvv0b52/.default" }).ExecuteAsync().Result;


// authenticationResult

= clientApp.AcquireTokenForClient(new String[] { "https://graph.microsoft.com/.default" }).ExecuteAsync().Result;


// authenticationResult

= clientApp.AcquireTokenForClient(new String[] { "https://analysis.windows.net/powerbi/api/.default" }).ExecuteAsync().Result;


authenticationResult

= clientApp.AcquireTokenForClient(new String[] { "https://graph.windows.net/.default" }).ExecuteAsync().Result;

 

 

 

 

Thanks.

 

 

 

 

 

3 Replies