Forum Discussion
PowerBI embedd on Salesforce using app owns data scenario
Thanks for your reply. As mentioned we have it working for the first scenario User owns data, and we have all the backend things on BI and AAD side in place. It is however the below part that is the core issue (copy paste the .net example), I have no issue running this example in a .net app however the problem is how to implement the AAD Client and do non-interactive authentication using username+password from APEX code. Or is there another option for authenticating the service user?
using Microsoft.IdentityModel.Clients.ActiveDirectory; // Create a user password cradentials.
var credential = new UserPasswordCredential(Username, Password); // Authenticate using created credentials var authenticationContext = new AuthenticationContext(AuthorityUrl); var authenticationResult = await authenticationContext.AcquireTokenAsync(ResourceUrl, ClientId, credential);
if (authenticationResult == null) {
return View(new EmbedConfig() { ErrorMessage = "Authentication Failed." }); }
var tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
Hi Johlindr,
Did you manage successfully the scenario Access token for non-Power BI users ( app owns data) ?
Many thanks for your answer.
Nuno.