Forum Discussion
Alternate to RedirectURL
- 8 years ago
mak82pk wrote:
Integrate a report into an app for your organization (https://docs.microsoft.com/en-us/power-bi/developer/integrate-report)
I am following the above example in my MVC 5 application. I will have reports in different URLs. Therefore, I dont want to generate client id for each report separately and assigned redirect url to get authentication code.
I think you can use one registered app. Just re-direct to the different embedding pages accordingly.
//After you get an AccessToken, you can call Power BI API operations such as Get Tile Session["AccessToken"] = GetAccessToken( Request.Params.GetValues("code")[0], Settings.Default.ClientID, Settings.Default.ClientSecret, Settings.Default.RedirectUrl); //Redirect to the embedding page Response.Redirect("/embeding page path");By the way, for any security concern, you'd better mask the user name in the snapshot.
mak82pk wrote:
Integrate a report into an app for your organization (https://docs.microsoft.com/en-us/power-bi/developer/integrate-report)
I am following the above example in my MVC 5 application. I will have reports in different URLs. Therefore, I dont want to generate client id for each report separately and assigned redirect url to get authentication code.
I think you can use one registered app. Just re-direct to the different embedding pages accordingly.
//After you get an AccessToken, you can call Power BI API operations such as Get Tile
Session["AccessToken"] = GetAccessToken(
Request.Params.GetValues("code")[0],
Settings.Default.ClientID,
Settings.Default.ClientSecret,
Settings.Default.RedirectUrl);
//Redirect to the embedding page
Response.Redirect("/embeding page path");
By the way, for any security concern, you'd better mask the user name in the snapshot.