Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
CRMPowerBI
Employee
Employee

Example Request: How to Authenticate (Silently) with Javascript to Power BI Rest API

Hello,

 

I am trying to create a client that will authenticate to PowerBI via JavaScript. I have attempted to use the ADAL JS but none of the examples actually show how to authenticate to a service... They show how to protect your service using ADAL, which I don't want. Or they show how to redirect you to a sign in page, which I don't want.

 

Any chance anyone has an example that uses JavaScript so I can grab some data and create my own dashboard.

 

Pretty please 🙂

 

Thanks!

9 REPLIES 9
venkateshappala
New Member

Do we have any code sample for this?

Did you find a solution to this?

 

Thanks

Nope, no answer.

 

I am posted on the MSDN priority forums on how to do OATH2 "service" authentication (which is what I want to do here), using JavaScript and all I kept getting was pointed at the same sample over and over that isn't a client side authorization example (service), it's a SingularJS WebAPI controller method protection example using ADAL

 

I am sure this is possible... just not something I have pieced together.

 

Cheers.

Hi there,

 

Did you get any further with this... Seems we've also hit the same roadblock; trying to do this entirely in javascript. We know that we can host a Web Service somewhere to act as a proxy and get around the cross-domain challenge, but then we're not going to achieve what we set out to do: a pure client-scripted approach that we can embed anywhere.

 

Would be great if you could provide an update on where you're at with this...

 

Jason

____________________________________________________
My other computer is an Azure data centre.

Sorry I didn't get anywhere on this.

 

Doesn't seem possible. If it is, it's such a closely regarded secret no one wants to tell.... Stinks, if you want to create cross domain , cross platform non-aspx pages, how in the world are you supposed to do it, if you can't authenticate.

Hi guys.

 

@CRMPowerBI when you say that you've constantly pointed to the same example, did you mean this one?

 

Here is my understanding of what adal.js is, and why you have to create a proxy : 

- Adal.js is a lib to authenticate users against a directory which is hosted on azure.

- Authentication is the process of ascertaining that somebody really is who he claims to be.

- OAuth2 implicit grant, which is supported by Adal.js is about obtaining a token (to signing in the user), for accessing our own backend API.

 

But, there might be a solution if you want to choose the client side route, as stated in this stackoverflow thread.

 

Hope this helps.

 

Thank you for that pointer.

 

I will see how to make this productionizable and hopefully that will be possible.

 

It would be / will be nice when the BI team creates a sample. It will be harder and harder to expect people to "login" each time to select things to show, especially at an integration into other apps.

 

Cheers and thank you very much

Did you (or anyone else) find how it could be done.

Without this functionality the REST API is useless

Has anyone managed to get a sample for this?

I am struggling to get this in place

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors