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

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

      1. <small id='MBIcg'></small><noframes id='MBIcg'>

        <legend id='MBIcg'><style id='MBIcg'><dir id='MBIcg'><q id='MBIcg'></q></dir></style></legend>
        <tfoot id='MBIcg'></tfoot>
      2. 如何使用 JwtSecurityTokenHandler 和 JWKS 端點驗證 JW

        How do I validate a JWT using JwtSecurityTokenHandler and a JWKS endpoint?(如何使用 JwtSecurityTokenHandler 和 JWKS 端點驗證 JWT?)

        <small id='2GVWv'></small><noframes id='2GVWv'>

          <tbody id='2GVWv'></tbody>
          <bdo id='2GVWv'></bdo><ul id='2GVWv'></ul>

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

              <legend id='2GVWv'><style id='2GVWv'><dir id='2GVWv'><q id='2GVWv'></q></dir></style></legend>
            • <tfoot id='2GVWv'></tfoot>
                  本文介紹了如何使用 JwtSecurityTokenHandler 和 JWKS 端點驗證 JWT?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在制作使用 IdentityServer4 來保護多個服務的原型,但需要注意的是,這些服務可能不會被遷移(在可預見的將來)以使用 ASP.NET Core 的 OWIN 中間件慣用語.因此,我無法通過簡單地提供 IdentityServer 的知名 JWKS 端點等方式來利用許多中間件助手來自動驗證 JWT.

                  I am prototyping the use of IdentityServer4 to secure several services, with the caveat that those services will likely not be migrated (in the forseeable future) to use the OWIN middleware idiom of ASP.NET Core. Consequently, I can not leverage the many middleware helpers that automate the validation of a JWT by simply providing the well-known JWKS endpoint of IdentityServer, among other things.

                  如果我能重建這種行為就好了,我想利用微軟的 JwtSecurityTokenHandler 實現(如果可能).但是,我不知道如何利用 IdentityServer 的發現端點提供的 JsonWebKeySetJsonWebKey 類型來提取密鑰并執行驗證.

                  It would be nice if I could reconstruct this behavior, and I'd like to leverage Microsoft's JwtSecurityTokenHandler implementation if possible. However, I can not figure out how to utilize the JsonWebKeySet and JsonWebKey types provided via IdentityServer's discovery endpoint to extract keys and perform the validation.

                  JwtSecurityTokenHandler 使用 TokenValidationParameters 來驗證 JWT,這些參數需要一個或多個 SecurityKey 對象來執行驗證.

                  JwtSecurityTokenHandler uses TokenValidationParameters to validate a JWT, and those parameters require an instance of one or more SecurityKey objects to perform the validation.

                  ClaimsPrincipal ValidateJwt(string token, IdentityModel.Client.DiscoveryResponse discovery)
                  {
                      JwtSecurityToken jwt = new JwtSecurityToken(token);
                  
                      TokenValidationParameters validationParameters = new TokenValidationParameters
                      {
                          ValidateAudience = true,
                          ValidateIssuer = true,
                          RequireSignedTokens = true,
                          ValidIssuer = "expected-issuer",
                          ValidAudience = "expected-audience",
                          IssuerSigningKeys = discovery.KeySet.Keys /* not quite */
                      };
                  
                      JwtSecurityTokenHandler handler = new JwtSecurityTokenHandler();
                      SecurityToken validatedToken;
                      return handler.ValidateToken(jwt, validationParameters, out validatedToken);
                  }
                  

                  如何執行從 JsonWebKeySetIEnumerable 的必要轉換,以便進行驗證?是否有另一種方法(除了 OWIN 中間件)也可以使用上面的 DiscoveryResponse 數據?

                  How do I perform the necessary translation from JsonWebKeySet to IEnumerable<SecurityKey> so that the validation can occur? Is there another method (apart from OWIN middleware) that will also work using the DiscoveryResponse data above?

                  (遺憾的是,System.IdentityModel.Tokens.Jwt 的文檔不是最新的.)

                  (Sadly, the documentation for System.IdentityModel.Tokens.Jwt is not up to date.)

                  推薦答案

                  查看此示例:

                  https:///github.com/IdentityServer/IdentityServer4/blob/master/samples/Clients/old/MvcManual/Controllers/HomeController.cs#L148

                  它從 JWK 手動檢索密鑰并填充驗證參數.

                  It manually retrieves the key from the JWK and populates the validation parameters.

                  這篇關于如何使用 JwtSecurityTokenHandler 和 JWKS 端點驗證 JWT?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  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)
                  ASP.net C# Gridview ButtonField onclick event(ASP.net C# Gridview ButtonField onclick 事件)
                  Adding OnClick event to ASP.NET control(將 OnClick 事件添加到 ASP.NET 控件)
                  Multiple submit Button click problem?(多個提交按鈕點擊問題?)

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

                      <tfoot id='JRQjb'></tfoot>

                          <tbody id='JRQjb'></tbody>

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

                            <legend id='JRQjb'><style id='JRQjb'><dir id='JRQjb'><q id='JRQjb'></q></dir></style></legend>
                            主站蜘蛛池模板: 日本激情一区二区 | 91亚洲国产成人精品一区二三 | 国内精品久久久久久久 | 91久久北条麻妃一区二区三区 | 亚洲一区国产精品 | 国产精品五区 | 色综合久 | 午夜精品一区二区三区在线观看 | 精品久久精品 | 91av在线视频观看 | 日本小电影网站 | 91天堂网| 久久久亚洲一区 | 国产一二三视频在线观看 | 男女搞网站| 青青草久久 | 91大神在线看| 超碰成人在线观看 | 一二三四在线视频观看社区 | 男人天堂国产 | 黄色一级大片在线免费看产 | 久久免费精品视频 | 久久男人 | 91av在线免费观看 | 亚洲激情av| 国产精品福利在线 | 中文av电影 | 91免费电影 | 福利视频一区二区 | 亚洲a视| 黄网站免费在线观看 | 国产你懂的在线观看 | 日本成人福利视频 | 天天爽夜夜骑 | 国产欧美精品一区二区 | 日韩精品一区二区三区免费视频 | 欧美精品在线免费 | 99久久精品国产毛片 | 久久久国产一区二区三区四区小说 | 国产成人亚洲精品 | 国产日韩av一区二区 |