Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
Is there any httpResponse method or way to get the authentication code for example i tried to do something...
var request = (HttpWebRequest)WebRequest.CreateHttp($"{Properties.Settings.Default.AADAuthorityUri}?{queryString}"); request.Method = "GET"; var response = (HttpWebResponse)request.GetResponse(); //... (initialize more fields) using (StreamReader sr = new StreamReader(response.GetResponseStream())) { string result = sr.ReadToEnd(); dynamic o = JsonConvert.DeserializeObject(result); var token = o.code; // Console.WriteLine("I got Http Status Code: {0}", response.StatusCode); }
so that I can just get the token and pass it to View to display report.
Solved! Go to Solution.
@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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
65 | |
45 | |
39 | |
31 |
User | Count |
---|---|
164 | |
111 | |
61 | |
53 | |
38 |