Forum Discussion
Register with AAD V2 and authenticate using MSAL.js or ADAL.js
Hi,
Is it possible to authenticate to apps registered with AAD v2 for PowerBI via MSAL or ADAL?
It would be great if we get any sample code.
Regards,
Yasotha
3 Replies
- Eric_Zhang
Microsoft Employee
Yaostha wrote:
Hi,
Is it possible to authenticate to apps registered with AAD v2 for PowerBI via MSAL or ADAL?
It would be great if we get any sample code.
Regards,
Yasotha
Don't know much about AAD v2, hope those threads help.
- Yaostha
Helper II
Hi Eric_Zhang,
Thanks for the reply.
Now I got another doubt.
How do we get the Microsoft.PowerBI.Api.V2.Models.EmbedToken generated using powerbi javascript? Is it possible?
I have below code in my .cs file. I am looking to replace the same using javascript approach.
using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))
{// Generate Embed Token.
var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view");
var tokenResponse = await client.Dashboards.GenerateTokenInGroupAsync(GroupId, DashboardId, generateTokenRequestParameters);}
Regards,
Yasotha
- Eric_Zhang
Microsoft Employee
Yaostha wrote:
Hi Eric_Zhang,
Thanks for the reply.
Now I got another doubt.
How do we get the Microsoft.PowerBI.Api.V2.Models.EmbedToken generated using powerbi javascript? Is it possible?
I have below code in my .cs file. I am looking to replace the same using javascript approach.
using (var client = new PowerBIClient(new Uri(ApiUrl), tokenCredentials))
{// Generate Embed Token.
var generateTokenRequestParameters = new GenerateTokenRequest(accessLevel: "view");
var tokenResponse = await client.Dashboards.GenerateTokenInGroupAsync(GroupId, DashboardId, generateTokenRequestParameters);}
Regards,
Yasotha
Just call the API GenerateToken in Javascript API or JQuery.