久久久久久久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>
                            主站蜘蛛池模板: 天天综合久久 | 国产一区二区三区在线 | 欧美13videosex性极品 | 亚洲国产网 | 亚洲精品久久久蜜桃 | 91九色视频 | 欧美黄色一区 | 欧美日韩福利视频 | 久久在线| 国产精品久久久久久久久久免费看 | 欧美一二三四成人免费视频 | 色综合视频 | 欧美在线观看一区 | 一区二区中文字幕 | 国产午夜精品一区二区三区嫩草 | 草草在线观看 | 久久国产精品视频 | 特级生活片| 国产在线中文字幕 | 国产精品免费一区二区三区 | 国产第一页在线播放 | 99精品一区二区 | 日本一区二区视频 | 日韩中文字幕 | 毛片a级毛片免费播放100 | 国产欧美在线视频 | 一区在线免费视频 | 91免费看片 | 欧美全黄 | 国产精品久久久久一区二区三区 | 男人av的天堂 | 中文字幕日韩在线 | 国产不卡视频 | 亚洲第一天堂无码专区 | 男女深夜网站 | 国产欧美精品一区二区色综合 | 国产视频一区在线 | 在线国产小视频 | 国产电影一区二区在线观看 | 精品一区二区三区在线视频 | 亚洲成人三区 |