Forum Discussion
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 .
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
- BhushanMahajanFrequent Visitor
One more thing ,
grant_type = client_credentials and for scope - https://analysis.windows.net/powerbi/api/.default
Roles -
grant_type = client_credentials and for scope - https://iGrxxxxxxxxx.onmicrosoft.com/edvvvvvvvvv0b52/.default
Roles do not appear
grant_type = client_credentials and for scope - https://graph.microsoft.com/.default
Roles -
grant_type = client_credentials and for scope - https://graph.windows.net/.default
Roles -
In case of grant_type = password and For scope - https://analysis.windows.net/powerbi/api/.default
it works since scope of workspace read is there .
- BhushanMahajanFrequent Visitor
Hi,
One more update -
i have set app name (i.e. service principal name ) as Admin in https://app.powerbi.com
I have give all required access in Tenant setting of Admin of Power BI .
- v-luwang-msftCommunity Support