cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Yaostha Regular Visitor
Regular Visitor

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 3
Moderator Eric_Zhang
Moderator

Re: Register with AAD V2 and authenticate using MSAL.js or ADAL.js


@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


@Yaostha

Don't know much about AAD v2, hope those threads help.

Azure Active Directory Code Samples

ADAL.js

PowerBI-Developer-Samples

Yaostha Regular Visitor
Regular Visitor

Re: Register with AAD V2 and authenticate using MSAL.js or ADAL.js

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

Moderator Eric_Zhang
Moderator

Re: Register with AAD V2 and authenticate using MSAL.js or ADAL.js


@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


@Yaostha

Just call the API GenerateToken in Javascript API or JQuery.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 501 members 3,902 guests
Please welcome our newest community members: