pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <bdo id='ehKqC'></bdo><ul id='ehKqC'></ul>
    <legend id='ehKqC'><style id='ehKqC'><dir id='ehKqC'><q id='ehKqC'></q></dir></style></legend>

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

      1. <i id='ehKqC'><tr id='ehKqC'><dt id='ehKqC'><q id='ehKqC'><span id='ehKqC'><b id='ehKqC'><form id='ehKqC'><ins id='ehKqC'></ins><ul id='ehKqC'></ul><sub id='ehKqC'></sub></form><legend id='ehKqC'></legend><bdo id='ehKqC'><pre id='ehKqC'><center id='ehKqC'></center></pre></bdo></b><th id='ehKqC'></th></span></q></dt></tr></i><div class="qwmowcy" id='ehKqC'><tfoot id='ehKqC'></tfoot><dl id='ehKqC'><fieldset id='ehKqC'></fieldset></dl></div>
        <tfoot id='ehKqC'></tfoot>

        驗證 JWT 簽名時出現 SecurityTokenSignatureKeyNotFoundE

        SecurityTokenSignatureKeyNotFoundException when validating JWT signature(驗證 JWT 簽名時出現 SecurityTokenSignatureKeyNotFoundException)
              <tbody id='h91U1'></tbody>

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

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

                1. <i id='h91U1'><tr id='h91U1'><dt id='h91U1'><q id='h91U1'><span id='h91U1'><b id='h91U1'><form id='h91U1'><ins id='h91U1'></ins><ul id='h91U1'></ul><sub id='h91U1'></sub></form><legend id='h91U1'></legend><bdo id='h91U1'><pre id='h91U1'><center id='h91U1'></center></pre></bdo></b><th id='h91U1'></th></span></q></dt></tr></i><div class="wg2muki" id='h91U1'><tfoot id='h91U1'></tfoot><dl id='h91U1'><fieldset id='h91U1'></fieldset></dl></div>
                  <tfoot id='h91U1'></tfoot>
                  <legend id='h91U1'><style id='h91U1'><dir id='h91U1'><q id='h91U1'></q></dir></style></legend>
                2. 本文介紹了驗證 JWT 簽名時出現 SecurityTokenSignatureKeyNotFoundException的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試為我的組織實施 OpenID Connect 規范.我在測試依賴方應用程序中使用 Microsoft 的 OpenID Connect OWIN 實現來驗證我的協議實現.

                  I'm trying to implement the OpenID Connect specification for my organisation. I'm using Microsoft's OWIN implementation of OpenID Connect in a test relying party application to verify my implementation of the protocol.

                  我公開了以下元數據文檔:

                  I've exposed the following metadata document:

                  {
                    "issuer": "https://acs.contoso.com/",
                    "authorization_endpoint": "http://localhost:53615/oauth2/auth",
                    "token_endpoint": "http://localhost:53615/oauth2/token",
                    "userinfo_endpoint": "http://localhost:53615/connect/userinfo",
                    "jwks_uri": "http://localhost:53615/connect/keys",
                    "ui_locales_supported": [
                      "en-GB"
                    ]
                  }
                  

                  簽名密鑰公開為該文檔:

                  The signing key is exposed as this document:

                  {
                    "keys": [
                      {
                        "n": "xpXxl3M-YkZlzQJdArO1TfOGT2no-UL4dbZ7WuSCNIsSfyGDaqUXjMMHNyq9yD3vp-NCyk8kmn7d5XqHufnceXJM8q4xTrhN3lvywdBSbR-dwXsA-B-MJVgfiK0d_z-mxP9ew2Hj9-KkWbWCzsswlWp3gZ4mB4RGutB1IRSzXVIbvZ-MtKUb6XUDU4LDb_c1xCEXWZxhR-o1a1dLfObH2hHJ-w5y6odGlKtOFx4i4h0u7-Oj5R6k5b2YXEHM0IuYeN0u0sQvrTecokntGzPrvhnKy69I7Z_az5rC5kgloh25D9lTbe4vcRU7FXlYCFYDZsT0_IkGIXRi7brOS4f1ow",
                        "e": "AQAB",
                        "kty": "RSA",
                        "use": "sig",
                        "alg": "RS256",
                        "kid": "F8A59280B3D13777CC7541B3218480984F421450"
                      }
                    ]
                  }
                  

                  正在使用 JwtSecurityToken 類及其關聯的處理程序,使用 X509SigningCredentials 類.這段代碼代表了令牌是如何構造的,并作為響應數據的參數返回給調用系統.

                  The identity token is being generated using the JwtSecurityToken class and its associated handler, using the X509SigningCredentials class. This code is representative of how the token is constructed and returned to the calling system as a parameter of the response data.

                  var credentials = new X509SigningCredentials(cert); // My certificate.
                  var issuedTime = DateTime.UtcNow;
                  var expiresTime = issuedTime.AddMinutes(5);
                  var epoch = new DateTime(1970, 01, 01, 0, 0, 0);
                  
                  var claims = new[]
                  {
                      new Claim("sub", Guid.NewGuid().ToString()),
                      new Claim("iat" Math.Floor((issuedTime - epoch).TotalSeconds).ToString()),
                      new Claim("nonce", nonce), // Value from client
                  }
                  
                  var token = new JwtSecurityToken(
                      "https://acs.contoso.com",
                      client_id, // Value from client
                      claims,
                      new Lifetime(issuedTime, expiresTime),
                      credentials);
                  
                  var handler = new JwtSecurityTokenHandler();
                  parameters.Add("id_token", handler.WriteToken(token)); // Outgoing parameters.
                  

                  當我嘗試將簽名的令牌傳遞回依賴方應用程序時,OWIN 中間件接受 POST 并嘗試驗證令牌的簽名.這樣做會引發以下異常:

                  When I attempt to pass the signed token back to the relying party application, the OWIN middleware accepts the POST and attempts to verify the signature of the token. In doing so, the following exception is thrown:

                  SecurityTokenSignatureKeyNotFoundException: IDX10500: 簽名驗證失敗.無法解析 SecurityKeyIdentifier:'SecurityKeyIdentifier (IsReadOnly = False, Count = 1, Clause[0] =X509ThumbprintKeyIdentifierClause(哈希 =0xF8A59280B3D13777CC7541B3218480984F421450) ) ',令牌:'{"typ":"JWT","alg":"RS256","x5t":"-KWSgLPRN3fMdUGzIYSAmE9CFFA"}.{"iss":"https://test.accesscontrol.net/","aud":"test","nbf":1404917162,"exp":1404917462,"sub":"60eb55ec-0699-4068-bfa6-41666fc2b2e9","iat":"1404917162"}原始數據:eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ii1LV1NnTFBSTjNmTWRVR3pJWVNBbUU5Q0ZGQSJ9.eyJpc3MiOiJodHRwczovL2Fjcy5zdXJlY2xvdWQuY29tLyIsImF1ZCI6InRlc3QiLCJuYmYiOjE0MDQ5MTcxNjIsImV4cCI6MTQwNDkxNzQ2Miwic3ViIjoiNjBlYjU1ZWMtMDY5OS00MDY4LWJmYTYtNDE2NjZmYzJiMmU5IiwiaWF0IjoiMTQwNDkxNzE2MiJ9.xkP0RwlX3CYfU0KhFsVvLJC94WK22DTqNTm71cfjiJ8VUHv3b2YhDqfq70N8mQEyiR8vTR6OQqnO6UqXqX4RXUs6ZkfK9Liv3n9NhCs97wJhP2jfefJYeScYtRmWcNNWSSL7vkm2JXQfwKOQTnOGp-ba04TtI6jVrjhOQXH43eCJ9vNuBUzdD-t8CAdmnbvH0nWpIB8kWbw5v8Sa0aQuxMjJYbLC_2Iw3X13dqnyVjp4fA7eSB8N7c1it0KEB-VKfUqiGD3VecyEZGGZbaGE8rvVet5QrY1lJ3V4yM8j6-xDc5Yndc4swOun0L3D6TYk-8gdVXUJDRjbv1ZuhZltsw".

                  SecurityTokenSignatureKeyNotFoundException: IDX10500: Signature validation failed. Unable to resolve SecurityKeyIdentifier: 'SecurityKeyIdentifier ( IsReadOnly = False, Count = 1, Clause[0] = X509ThumbprintKeyIdentifierClause(Hash = 0xF8A59280B3D13777CC7541B3218480984F421450) ) ', token: '{"typ":"JWT","alg":"RS256","x5t":"-KWSgLPRN3fMdUGzIYSAmE9CFFA"}.{"iss":"https://test.accesscontrol.net/","aud":"test","nbf":1404917162,"exp":1404917462,"sub":"60eb55ec-0699-4068-bfa6-41666fc2b2e9","iat":"1404917162"} RawData: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ii1LV1NnTFBSTjNmTWRVR3pJWVNBbUU5Q0ZGQSJ9.eyJpc3MiOiJodHRwczovL2Fjcy5zdXJlY2xvdWQuY29tLyIsImF1ZCI6InRlc3QiLCJuYmYiOjE0MDQ5MTcxNjIsImV4cCI6MTQwNDkxNzQ2Miwic3ViIjoiNjBlYjU1ZWMtMDY5OS00MDY4LWJmYTYtNDE2NjZmYzJiMmU5IiwiaWF0IjoiMTQwNDkxNzE2MiJ9.xkP0RwlX3CYfU0KhFsVvLJC94WK22DTqNTm71cfjiJ8VUHv3b2YhDqfq70N8mQEyiR8vTR6OQqnO6UqXqX4RXUs6ZkfK9Liv3n9NhCs97wJhP2jfefJYeScYtRmWcNNWSSL7vkm2JXQfwKOQTnOGp-ba04TtI6jVrjhOQXH43eCJ9vNuBUzdD-t8CAdmnbvH0nWpIB8kWbw5v8Sa0aQuxMjJYbLC_2Iw3X13dqnyVjp4fA7eSB8N7c1it0KEB-VKfUqiGD3VecyEZGGZbaGE8rvVet5QrY1lJ3V4yM8j6-xDc5Yndc4swOun0L3D6TYk-8gdVXUJDRjbv1ZuhZltsw'.

                  該組件仍處于預發布狀態,因此這可能是實現中的一個缺陷,但我想在排除所有可能性之前假設這是我的錯誤.

                  The component is still pre-release, so this may be a flaw in the implementation, however I want to assume it's my error until all possibilities have been ruled out.

                  我在做什么顯然是錯誤的,或者我應該做些什么來準確了解簽名無法驗證的原因?

                  Is there anything I'm doing which is obviously wrong, or is there something I should do to understand exactly why the signature is failing to be validated?

                  推薦答案

                  問題出在此處的異常信息中:

                  The problem is nestled in the exception message here:

                  Clause[0] = X509ThumbprintKeyIdentifierClause(Hash = 0xF8A59280B3D13777CC7541B3218480984F421450)

                  Clause[0] = X509ThumbprintKeyIdentifierClause(Hash = 0xF8A59280B3D13777CC7541B3218480984F421450)

                  令牌使用 X.509 證書的默認密鑰標識符子句進行簽名:其指紋.元數據僅公開 RSA 參數和名稱標識符.當客戶端檢索元數據時,它使用此信息設置 RSA 密鑰,而不是 X.509 指紋.

                  The token is signed with the default key identifier clause for an X.509 certificate: its thumbprint. The metadata is exposing just the RSA parameters and a name identifier. When the client retrieves the metadata, it sets up an RSA key using this information, not an X.509 thumbprint.

                  要更正此錯誤,必須更改簽名憑據以包含正確的名稱標識符:

                  To correct this error, the signing credentials have to be changed to include the correct name identifier:

                  var credentials = new X509CertificateCredentials(
                      cert,
                      new SecurityKeyIdentifier(
                          new NamedKeySecurityKeyIdentifierClause(
                              "kid",
                              "F8A59280B3D13777CC7541B3218480984F421450")));
                  

                  這在簽名中包含了預期的標識符,并且簽名驗證成功.

                  This includes the expected identifier in the signature, and the signature is validated successfully.

                  這篇關于驗證 JWT 簽名時出現 SecurityTokenSignatureKeyNotFoundException的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                3. <i id='H3ZBr'><tr id='H3ZBr'><dt id='H3ZBr'><q id='H3ZBr'><span id='H3ZBr'><b id='H3ZBr'><form id='H3ZBr'><ins id='H3ZBr'></ins><ul id='H3ZBr'></ul><sub id='H3ZBr'></sub></form><legend id='H3ZBr'></legend><bdo id='H3ZBr'><pre id='H3ZBr'><center id='H3ZBr'></center></pre></bdo></b><th id='H3ZBr'></th></span></q></dt></tr></i><div class="iuskc2m" id='H3ZBr'><tfoot id='H3ZBr'></tfoot><dl id='H3ZBr'><fieldset id='H3ZBr'></fieldset></dl></div>

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

                  <tfoot id='H3ZBr'></tfoot>

                    <tbody id='H3ZBr'></tbody>
                    <legend id='H3ZBr'><style id='H3ZBr'><dir id='H3ZBr'><q id='H3ZBr'></q></dir></style></legend>

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

                          • 主站蜘蛛池模板: 北京网络营销推广_百度SEO搜索引擎优化公司_网站排名优化_谷歌SEO - 北京卓立海创信息技术有限公司 | 小区健身器材_户外健身器材_室外健身器材_公园健身路径-沧州浩然体育器材有限公司 | 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 洗砂机械-球磨制砂机-洗沙制砂机械设备_青州冠诚重工机械有限公司 | 高精度-恒温冷水机-螺杆式冰水机-蒸发冷冷水机-北京蓝海神骏科技有限公司 | 超声波清洗机_超声波清洗机设备_超声波清洗机厂家_鼎泰恒胜 | 办公室家具_板式办公家具定制厂家-FMARTS福玛仕办公家具 | 酒吧霸屏软件_酒吧霸屏系统,酒吧微上墙,夜场霸屏软件,酒吧点歌软件,酒吧互动游戏,酒吧大屏幕软件系统下载 | 济宁工业提升门|济宁电动防火门|济宁快速堆积门-济宁市统一电动门有限公司 | 不锈钢管件(不锈钢弯头,不锈钢三通,不锈钢大小头),不锈钢法兰「厂家」-浙江志通管阀 | SPC工作站-连杆综合检具-表盘气动量仪-内孔缺陷检测仪-杭州朗多检测仪器有限公司 | 自清洗过滤器,浅层砂过滤器,叠片过滤器厂家-新乡市宇清净化 | 郑州宣传片拍摄-TVC广告片拍摄-微电影短视频制作-河南优柿文化传媒有限公司 | 电渗析,废酸回收,双极膜-山东天维膜技术有限公司 | 钛板_钛管_钛棒_钛盘管-无锡市盛钛科技有限公司 | 行星搅拌机,双行星搅拌机,动力混合机,无锡米克斯行星搅拌机生产厂家 | 山东led显示屏,山东led全彩显示屏,山东LED小间距屏,临沂全彩电子屏-山东亚泰视讯传媒有限公司 | 法兰连接型电磁流量计-蒸汽孔板节流装置流量计-北京凯安达仪器仪表有限公司 | 玉米深加工机械,玉米加工设备,玉米加工机械等玉米深加工设备制造商-河南成立粮油机械有限公司 | 郑州水质检测中心_井水检测_河南废气检测_河南中环嘉创检测 | 北京森语科技有限公司-模型制作专家-展览展示-沙盘模型设计制作-多媒体模型软硬件开发-三维地理信息交互沙盘 | 冷水机,风冷冷水机,水冷冷水机,螺杆冷水机专业制造商-上海祝松机械有限公司 | 鄂泉泵业官网|(杭州、上海、全国畅销)大流量防汛排涝泵-LW立式排污泵 | 丹佛斯变频器-丹佛斯压力开关-变送器-广州市风华机电设备有限公司 | 镀锌角钢_槽钢_扁钢_圆钢_方矩管厂家_镀锌花纹板-海邦钢铁(天津)有限公司 | 液氮罐_液氮容器_自增压液氮罐_杜瓦瓶_班德液氮罐厂家 | 飞飞影视_热门电影在线观看_影视大全 | 湖南长沙商标注册专利申请,长沙公司注册代理记账首选美创! | 广东恩亿梯电源有限公司【官网】_UPS不间断电源|EPS应急电源|模块化机房|电动汽车充电桩_UPS电源厂家(恩亿梯UPS电源,UPS不间断电源,不间断电源UPS) | 卫生纸复卷机|抽纸机|卫生纸加工设备|做卫生纸机器|小型卫生纸加工需要什么设备|卫生纸机器设备多少钱一台|许昌恒源纸品机械有限公司 | 翅片管散热器价格_钢制暖气片报价_钢制板式散热器厂家「河北冀春暖气片有限公司」 | SPC工作站-连杆综合检具-表盘气动量仪-内孔缺陷检测仪-杭州朗多检测仪器有限公司 | 衬四氟_衬氟储罐_四氟储罐-无锡市氟瑞特防腐科技有限公司 | bng防爆挠性连接管-定做金属防爆挠性管-依客思防爆科技 | 全自动定氮仪-半自动凯氏定氮仪厂家-祎鸿仪器 | 淘气堡_室内儿童乐园_户外无动力儿童游乐设备-高乐迪(北京) | 玉米加工设备,玉米深加工机械,玉米糁加工设备.玉米脱皮制糁机 华豫万通粮机 | 胶辊硫化罐_胶鞋硫化罐_硫化罐厂家-山东鑫泰鑫智能装备有限公司 意大利Frascold/富士豪压缩机_富士豪半封闭压缩机_富士豪活塞压缩机_富士豪螺杆压缩机 | 谷歌关键词优化-外贸网站优化-Google SEO小语种推广-思亿欧外贸快车 | 冲锋衣滑雪服厂家-冲锋衣定制工厂-滑雪服加工厂-广东睿牛户外(S-GERT) | 贝朗斯动力商城(BRCPOWER.COM) - 买叉车蓄电池上贝朗斯商城,价格更超值,品质有保障! |