astro-panda / blazor-powerbi

An easy-to-use Razor Class Library for embedded Power BI reports
MIT License
5 stars 3 forks source link

fix demo Azure AD wireup #5

Closed Psypher9 closed 2 years ago

Psypher9 commented 2 years ago

Fixes the faulty Microsoft Identity Wireup in the Demo project mentioned by @johnhbarrett

johnhbarrett commented 2 years ago

Gets me a little further - now seeing:

ArgumentNullException: IDW10106: The 'Instance' option must be provided.

image

johnhbarrett commented 2 years ago

Ok, I think I see what's going on. There might be an assumption in the code that the security setup is Azure AD for auth.

Psypher9 commented 2 years ago

Okay that confirms it for me, this is the Microsoft Identity piece, because the PowerBIAuthenticationService doesn't require that. Well, for the time being you could add

"PowerBi": {
    "Instance": "https://login.microsoftonline.com/",
    ... // other props
    }

That should get you going

Psypher9 commented 2 years ago

Ok, I think I see what's going on. There might be an assumption in the code that the security setup is Azure AD for auth.

Well Microsoft Identity is assuming that piece but the Power BI components don't need all of the properties because it's creating an instance of IConfidentialClientApplication.

In our local development we were using that portion but we should definitely update it so that this is easier for others to get started by only plugging in some values

johnhbarrett commented 2 years ago

a bit further... :-) my app registration is required to handle the token - i can adapt to that for now...

image

Psypher9 commented 2 years ago

Progress though! Thanks for the feedback, this is really helpful! @Jesse-ww and I will be able to take this and make the package easier to use now

johnhbarrett commented 2 years ago

no problem - more than happy to help you guys out

johnhbarrett commented 2 years ago

I was able to get this working now: - I tweaked it a little because I'll be using a using a diff user-auth system ( JWT / Identity Server).

it might be useful to modify the code to pass thru an authenticated user for the purposes of RLS in power BI.
Ted Pattison has some samples here where he does just that.

johnhbarrett commented 2 years ago

So on for example on this line it's possible to build and set the Identities property from whatever context for a user you may have in the app. I think as long as PBI is set up with RLS (need to use Desktop initially) then it's quite straight forward to get it going.