久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <small id='5O4Ou'></small><noframes id='5O4Ou'>

    <i id='5O4Ou'><tr id='5O4Ou'><dt id='5O4Ou'><q id='5O4Ou'><span id='5O4Ou'><b id='5O4Ou'><form id='5O4Ou'><ins id='5O4Ou'></ins><ul id='5O4Ou'></ul><sub id='5O4Ou'></sub></form><legend id='5O4Ou'></legend><bdo id='5O4Ou'><pre id='5O4Ou'><center id='5O4Ou'></center></pre></bdo></b><th id='5O4Ou'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5O4Ou'><tfoot id='5O4Ou'></tfoot><dl id='5O4Ou'><fieldset id='5O4Ou'></fieldset></dl></div>
  2. <legend id='5O4Ou'><style id='5O4Ou'><dir id='5O4Ou'><q id='5O4Ou'></q></dir></style></legend>
      <bdo id='5O4Ou'></bdo><ul id='5O4Ou'></ul>

      <tfoot id='5O4Ou'></tfoot>

    1. 如何使用非交互式身份驗證連接到 Power BI API?

      how to connect to Power BI API using non-interactive authentication?(如何使用非交互式身份驗證連接到 Power BI API?)
        <legend id='Vh4iG'><style id='Vh4iG'><dir id='Vh4iG'><q id='Vh4iG'></q></dir></style></legend>
        <i id='Vh4iG'><tr id='Vh4iG'><dt id='Vh4iG'><q id='Vh4iG'><span id='Vh4iG'><b id='Vh4iG'><form id='Vh4iG'><ins id='Vh4iG'></ins><ul id='Vh4iG'></ul><sub id='Vh4iG'></sub></form><legend id='Vh4iG'></legend><bdo id='Vh4iG'><pre id='Vh4iG'><center id='Vh4iG'></center></pre></bdo></b><th id='Vh4iG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Vh4iG'><tfoot id='Vh4iG'></tfoot><dl id='Vh4iG'><fieldset id='Vh4iG'></fieldset></dl></div>

          <tfoot id='Vh4iG'></tfoot>
            <tbody id='Vh4iG'></tbody>

          <small id='Vh4iG'></small><noframes id='Vh4iG'>

          • <bdo id='Vh4iG'></bdo><ul id='Vh4iG'></ul>

                本文介紹了如何使用非交互式身份驗證連接到 Power BI API?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                用 C# 編碼.我正在關注本指南:

                Coding in C#. I'm following this guide:

                https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal/#authenticate-service-principal-with-password---powershell%E2%80%8C%E2%80%8B

                但它不起作用,而且它不是 Power BI 特定的,所以我不確定如何將它應用到 Power BI API.

                But it is not working and it is not Power BI specific so I'm not sure exactly how to apply it to the Power BI API.

                在嘗試連接到 Power BI 時,我收到了 403 Forbidden 響應.

                In my attempt to connect to Power BI I am getting a 403 Forbidden response.

                        var authenticationContext = new AuthenticationContext("https://login.windows.net/" + Properties.Settings.Default.TenantID);
                        var credential = new ClientCredential(clientId: Properties.Settings.Default.ClientID, clientSecret: Properties.Settings.Default.ClientSecretKey);
                        var result = authenticationContext.AcquireToken(resource: "https://management.core.windows.net/", clientCredential: credential);
                
                        if (result == null)
                        {
                            throw new InvalidOperationException("Failed to obtain the JWT token");
                        }
                
                        string accessToken = result.AccessToken;
                
                
                        string responseContent = string.Empty;
                
                        //The resource Uri to the Power BI REST API resource
                        string datasetsUri = "https://api.powerbi.com/v1.0/myorg/datasets";
                
                        //Configure datasets request
                        System.Net.WebRequest request = System.Net.WebRequest.Create(datasetsUri) as System.Net.HttpWebRequest;
                        request.Timeout = 20000;
                        request.Method = "GET";
                        request.ContentLength = 0;
                        request.Headers.Add("Authorization", String.Format("Bearer {0}", accessToken));
                
                        try
                        {
                
                            //Get datasets response from request.GetResponse()
                            using (var response = request.GetResponse() as System.Net.HttpWebResponse)
                            {
                                //Get reader from response stream
                                using (var reader = new System.IO.StreamReader(response.GetResponseStream()))
                                {
                                    responseContent = reader.ReadToEnd();
                
                                    //Deserialize JSON string
                                    //JavaScriptSerializer class is in System.Web.Script.Serialization
                                    JavaScriptSerializer json = new JavaScriptSerializer();
                                    Datasets datasets = (Datasets)json.Deserialize(responseContent, typeof(Datasets));
                
                                    resultsTextbox.Text = string.Empty;
                                    //Get each Dataset from 
                                    foreach (dataset ds in datasets.value)
                                    {
                                        resultsTextbox.Text += String.Format("{0}	{1}
                ", ds.Id, ds.Name);
                                    }
                                }
                            }
                        }
                        catch (WebException wex)
                        {
                            resultsTextbox.Text = wex.Message;
                        }
                    }
                

                推薦答案

                嘗試更改資源 URI:

                Try changing the resource URI:

                var result = authenticationContext.AcquireToken(resource: "https://management.core.windows.net/", clientCredential: credential);
                

                var result = authenticationContext.AcquireToken(resource: **"https://analysis.windows.net/powerbi/api"**, clientCredential: credential);
                

                您想為 power bi api 獲取令牌.

                You want to acquire a token for the power bi api.

                希望有所幫助.

                根據 OP 評論編輯更新答案:

                這是你需要做的.

                在 Azure AD 中創建一個本機應用程序"并獲取該客戶端 ID,不會有任何秘密.

                In Azure AD create a "Native App" and get that client ID there will be NO Secret.

                確保您擁有來自 Nuget Active Directory 身份驗證庫 2.23.302261847 的最新版本的 ADAL

                Make sure you have the latest version of ADAL from Nuget Active Directory Authentication Library 2.23.302261847

                您將需要使用此 Acquire Token Overload:

                You will need to use this Acquire Token Overload:

                authContext.AcquireToken("https://analysis.windows.net/powerbi/api", clientID, new UserCredential(<Username>, <Password>));
                

                2016-11-11

                ADAL 3.13.7 UserCredentail 不再具有上述定義的構造函數.有一個新的密封類 UserPasswordCredential

                ADAL 3.13.7 UserCredentail no longer has a constructor as defined above. There is a new sealed class UserPasswordCredential

                public sealed class UserPasswordCredential : UserCredential
                

                哪個構造函數與之前的 UserCredential 對象相匹配

                Which has the constructor that matches the former UserCredential object

                public UserPasswordCredential(string userName, string password)
                

                您可以通過以下方式獲取令牌:

                You can acquire the token by doing this:

                authContext.AcquireToken("https://analysis.windows.net/powerbi/api", clientID, new UserPasswordCredential(<Username>, <Password>));
                

                這篇關于如何使用非交互式身份驗證連接到 Power BI API?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Ignore whitespace while reading XML(讀取 XML 時忽略空格)
                XML to LINQ with Checking Null Elements(帶有檢查空元素的 XML 到 LINQ)
                Reading XML with unclosed tags in C#(在 C# 中讀取帶有未閉合標簽的 XML)
                Parsing tables, cells with Html agility in C#(在 C# 中使用 Html 敏捷性解析表格、單元格)
                delete element from xml using LINQ(使用 LINQ 從 xml 中刪除元素)
                Parse malformed XML(解析格式錯誤的 XML)

                <legend id='oGBU6'><style id='oGBU6'><dir id='oGBU6'><q id='oGBU6'></q></dir></style></legend>

                  <small id='oGBU6'></small><noframes id='oGBU6'>

                    • <bdo id='oGBU6'></bdo><ul id='oGBU6'></ul>
                        <tbody id='oGBU6'></tbody>
                      <i id='oGBU6'><tr id='oGBU6'><dt id='oGBU6'><q id='oGBU6'><span id='oGBU6'><b id='oGBU6'><form id='oGBU6'><ins id='oGBU6'></ins><ul id='oGBU6'></ul><sub id='oGBU6'></sub></form><legend id='oGBU6'></legend><bdo id='oGBU6'><pre id='oGBU6'><center id='oGBU6'></center></pre></bdo></b><th id='oGBU6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='oGBU6'><tfoot id='oGBU6'></tfoot><dl id='oGBU6'><fieldset id='oGBU6'></fieldset></dl></div>

                          <tfoot id='oGBU6'></tfoot>
                        1. 主站蜘蛛池模板: 99精品欧美| 日韩一级一区 | 国产精品美女久久久久久不卡 | 国产一区二区影院 | 欧美亚洲在线视频 | 日韩第一区 | 人人干超碰 | 久久天天躁狠狠躁夜夜躁2014 | 精品一二三区在线观看 | 久久久www成人免费无遮挡大片 | 六月色婷| 免费在线看黄视频 | av超碰| 国产日韩一区二区三区 | 国产网站在线播放 | 成人av电影在线 | 成人av一区 | 欧美极品在线 | 日韩高清av| 噜久寡妇噜噜久久寡妇 | 性色在线 | 国内精品久久久久 | 精品国产一区二区三区久久久久久 | 欧美一级在线 | 欧美在线国产精品 | 亚洲一区毛片 | 成人精品一区亚洲午夜久久久 | 国产亚洲精品91 | 一区二区日韩 | 美女爽到呻吟久久久久 | 亚洲在线成人 | 日本天堂视频在线观看 | 国产在线视频在线观看 | 好婷婷网 | 成人欧美一区二区三区黑人孕妇 | 午夜免费视频观看 | 中文字幕不卡视频在线观看 | 午夜www | 激情综合五月天 | 国产黄色网址在线观看 | 精品久久久久一区二区国产 |