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

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

    3. <tfoot id='8lLfx'></tfoot>

        如何從經過身份驗證的 SecurityToken 中獲取聲明

        How to get the claims out of a authenticated SecurityToken(如何從經過身份驗證的 SecurityToken 中獲取聲明)
        <tfoot id='E4Lti'></tfoot>

          <tbody id='E4Lti'></tbody>

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

              <bdo id='E4Lti'></bdo><ul id='E4Lti'></ul>
              <i id='E4Lti'><tr id='E4Lti'><dt id='E4Lti'><q id='E4Lti'><span id='E4Lti'><b id='E4Lti'><form id='E4Lti'><ins id='E4Lti'></ins><ul id='E4Lti'></ul><sub id='E4Lti'></sub></form><legend id='E4Lti'></legend><bdo id='E4Lti'><pre id='E4Lti'><center id='E4Lti'></center></pre></bdo></b><th id='E4Lti'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='E4Lti'><tfoot id='E4Lti'></tfoot><dl id='E4Lti'><fieldset id='E4Lti'></fieldset></dl></div>
              • <legend id='E4Lti'><style id='E4Lti'><dir id='E4Lti'><q id='E4Lti'></q></dir></style></legend>
                • 本文介紹了如何從經過身份驗證的 SecurityToken 中獲取聲明的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我將令牌作為字符串傳遞給 SOAP 服務,并已驗證該令牌有效.我現在有一個 SecurityToken,在調試模式下我可以看到所有聲明,特別是我想傳遞給另一個方法的 userId 聲明.我似乎無法弄清楚如何獲得索賠.現在我解碼了令牌的字符串版本(令牌的未經驗證的字符串版本,我至少等到成功驗證之后.)這是代碼塊:

                  I'm passing a token as a string into a SOAP service and have validated that the token is valid. I now have a SecurityToken that in debug mode I can see all the claims and specifically the userId claim I'd like to pass into another method. I can't seem to figure out how to get at the claims. For now I decoded the string version of the token (the none validated string version of the token, I at least waited until after a successful validation.) Here is that code block:

                  SecurityToken validatedToken = null;
                  
                  if (VerifyToken(sPassword, ref response, ref validatedToken))
                  {
                      var claimsObj = JObject.Parse(Encoding.UTF8.GetString(Base64Url.Decode(claims)));
                      JToken userId = claimsObj.GetValue("userId");
                      return implClass.Process(userId);
                  }
                  

                  如何從 SecurityToken 中獲取聲明?

                  How do I get the claims out of a SecurityToken?

                  validatedToken.Id; // not it
                  validatedToken.ToClaimsPrincipal(cert); // doesn't work
                  

                  就暴露的屬性而言,我似乎沒有其他任何希望,但由于我可以在調試器中看到聲明,我確信有一種我只是沒有看到的方法.

                  Nothing else seemed promising to me as far as exposed properties, but since I can see the claims in the debugger I'm sure there is a way that I'm just not seeing.

                  推薦答案

                  我剛剛也遇到了同樣的情況,就是在調試的時候,SecurityToken 上可以看到 Payload 屬性,但是在編輯代碼的時候好像沒有 Payload 屬性.

                  I just experienced the same thing, namely that while debugging, a Payload property is visible on the SecurityToken but there appears to be no Payload property when editing the code.

                  看起來SecurityToken的底層類型是JwtSecurityToken(盡管securityCode.GetType()的QuickWatch返回SecurityToken,而不是JwtSecurityToken.).無論如何,轉換為實際的底層類型并引用 Payload 集合對我來說是訣竅.

                  It looks like the underlying type of the SecurityToken is JwtSecurityToken (despite the QuickWatch of securityCode.GetType() returning SecurityToken, rather than JwtSecurityToken.). Anyway, casting to the actual underlying type and referencing the Payload collection did the trick for me.

                  一種解決方案:

                  string userId = ((JwtSecurityToken)access_token).Payload["userId"].ToString();
                  

                  這篇關于如何從經過身份驗證的 SecurityToken 中獲取聲明的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                • <small id='PFbjn'></small><noframes id='PFbjn'>

                  • <bdo id='PFbjn'></bdo><ul id='PFbjn'></ul>
                    • <legend id='PFbjn'><style id='PFbjn'><dir id='PFbjn'><q id='PFbjn'></q></dir></style></legend><tfoot id='PFbjn'></tfoot>

                            <i id='PFbjn'><tr id='PFbjn'><dt id='PFbjn'><q id='PFbjn'><span id='PFbjn'><b id='PFbjn'><form id='PFbjn'><ins id='PFbjn'></ins><ul id='PFbjn'></ul><sub id='PFbjn'></sub></form><legend id='PFbjn'></legend><bdo id='PFbjn'><pre id='PFbjn'><center id='PFbjn'></center></pre></bdo></b><th id='PFbjn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PFbjn'><tfoot id='PFbjn'></tfoot><dl id='PFbjn'><fieldset id='PFbjn'></fieldset></dl></div>
                              <tbody id='PFbjn'></tbody>
                            主站蜘蛛池模板: 日韩at| 一级黄色绿像片 | 91免费在线视频 | 91久久伊人 | 精品无码久久久久久久动漫 | 亚洲午夜av久久乱码 | 日韩精品在线观看免费 | 婷婷在线免费 | 老子午夜影院 | 久久久久久美女 | 91av导航| 一区二区视频在线观看 | 91在线观看免费 | 亚洲国产精品久久久 | 久久夜视频 | 亚洲www啪成人一区二区麻豆 | 久久成人免费 | 成人免费淫片aa视频免费 | 黑人巨大精品 | 亚洲国产成人精品一区二区 | 亚洲va欧美va人人爽午夜 | av在线免费网站 | 国产成人精品午夜视频免费 | 日韩欧美在线一区 | 免费在线视频一区二区 | 亚洲毛片网站 | 国产精品视频97 | 99亚洲精品 | 久久久精品 | 日本久久久影视 | 中文字幕男人的天堂 | 久久久久久久国产精品影院 | 99久久婷婷国产亚洲终合精品 | 亚洲精品日韩在线 | 一级a毛片 | 久久午夜精品福利一区二区 | 看一级毛片视频 | 亚洲激情在线观看 | 午夜视频在线免费观看 | 国产高清在线观看 | 久久99精品久久久久久狂牛 |