syedaliammar wrote:Hi,
I have an ASP.NET web app that would push data to a PowerBI real-time dashboard. Following the steps of "Push data into dashboard", I registered my web-app and got a client id and secret.
The following code gets me the token:
AuthenticationContext authContext = new AuthenticationContext(authorityUri); ClientCredential cc = new ClientCredential(clientID, clientSecret); Task<AuthenticationResult> task = authContext.AcquireTokenAsync(resourceUri, cc); AuthenticationResult ar = task.Result;
string token = ar.AccessToken;I use this since I do not want an interactive logon. The web-app will just keep pushing data to the dashboard every time it has something new. The token is successfully received and is then used to create a dataset.
The server responds with a 403 Forbidden error message. The only reason that comes to my mind is that it might be because I have two Active Directories. My web-app is in AAD 1 (the corporate AAD) while the dev.powerbi.com/apps page registers the application to AAD 2.
I unfortunately do not have access to add applications to AAD1 and hence must wait for the admin to respond.
My question: Have I correctly identified the root cause of the problem or is it something else that I might have completely left out?
I got confused by the bold part, isn't the web-app regisitered on the dev.powerbi.com/apps? if the same thing, how come two AAD invloved in this case?