I need to get Azure AD Access token from Vanilla Javascript code to use it for Power BI reports. I could get some working samples in .net from https://github.com/microsoft/PowerBI-Developer-Samples. But as the website that am using built on third part wordpress like CMS I can't use it.
All i need is to get Azure AD access token from vanilla javascript or either some post man request?
I have below configuration values for my power BI report,
"AzureAd": { "AuthenticationMode": "ServicePrincipal", "AuthorityUri": "https://login.microsoftonline.com/organizations/", "ClientId": "XXXXXXXXX", "TenantId": "XXXXXXXXXXX", "Scope": [ "https://analysis.windows.net/powerbi/api/.default" ], "PbiUsername": "", "PbiPassword": "", "ClientSecret": "XXXXXXXXXX" }, "PowerBI": { "WorkspaceId": "XXXXXXXXXXX", "ReportId": "XXXXXXXXXXX" },
I have tried few javascript samples from below github repo but they did not work, https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-browser.
Any idea how to get it?