We are trying to utilize REST API of Power BI which allows to integrate a Power BI report into an application.
We have created an application within our Microsoft Azure Active Directory and given permission for Microsoft Power BI Reporting.
We are facing below issues while integrating PowerBI report from WebAPI.
1. Acquiring the token from the AZURE Active Directory.
How do we achieve the “Access Token” without user interaction? ( i.e. not showing Microsoft Authentication Popup).
We tried getting access token using below code, however the token which we received gives forbidden error.
TokenCache TC = new TokenCache();
ClientCredential CC = new ClientCredential (clientID,SecretID);
Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext authenticationContext1= new Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext(authorityUri, TC);
AuthenticationResult result3 = authenticationContext.AcquireTokenAsync(resourceUri, CC).Result;