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

      <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="qwawimqqmiuu" id='ehKqC'><tfoot id='ehKqC'></tfoot><dl id='ehKqC'><fieldset id='ehKqC'></fieldset></dl></div>
        <tfoot id='ehKqC'></tfoot>

        驗(yàn)證 JWT 簽名時(shí)出現(xiàn) SecurityTokenSignatureKeyNotFoundE

        SecurityTokenSignatureKeyNotFoundException when validating JWT signature(驗(yàn)證 JWT 簽名時(shí)出現(xiàn) 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="qwawimqqmiuu" 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. 本文介紹了驗(yàn)證 JWT 簽名時(shí)出現(xiàn) SecurityTokenSignatureKeyNotFoundException的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我正在嘗試為我的組織實(shí)施 OpenID Connect 規(guī)范.我在測(cè)試依賴(lài)方應(yīng)用程序中使用 Microsoft 的 OpenID Connect OWIN 實(shí)現(xiàn)來(lái)驗(yàn)證我的協(xié)議實(shí)現(xiàn).

                  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.

                  我公開(kāi)了以下元數(shù)據(jù)文檔:

                  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"
                    ]
                  }
                  

                  簽名密鑰公開(kāi)為該文檔:

                  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 類(lèi)及其關(guān)聯(lián)的處理程序,使用 X509SigningCredentials 類(lèi).這段代碼代表了令牌是如何構(gòu)造的,并作為響應(yīng)數(shù)據(jù)的參數(shù)返回給調(diào)用系統(tǒng).

                  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.
                  

                  當(dāng)我嘗試將簽名的令牌傳遞回依賴(lài)方應(yīng)用程序時(shí),OWIN 中間件接受 POST 并嘗試驗(yàn)證令牌的簽名.這樣做會(huì)引發(fā)以下異常:

                  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: 簽名驗(yàn)證失敗.無(wú)法解析 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"}原始數(shù)據(jù):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'.

                  該組件仍處于預(yù)發(fā)布狀態(tài),因此這可能是實(shí)現(xiàn)中的一個(gè)缺陷,但我想在排除所有可能性之前假設(shè)這是我的錯(cuò)誤.

                  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.

                  我在做什么顯然是錯(cuò)誤的,或者我應(yīng)該做些什么來(lái)準(zhǔn)確了解簽名無(wú)法驗(yàn)證的原因?

                  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?

                  推薦答案

                  問(wèn)題出在此處的異常信息中:

                  The problem is nestled in the exception message here:

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

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

                  令牌使用 X.509 證書(shū)的默認(rèn)密鑰標(biāo)識(shí)符子句進(jìn)行簽名:其指紋.元數(shù)據(jù)僅公開(kāi) RSA 參數(shù)和名稱(chēng)標(biāo)識(shí)符.當(dāng)客戶(hù)端檢索元數(shù)據(jù)時(shí),它使用此信息設(shè)置 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.

                  要更正此錯(cuò)誤,必須更改簽名憑據(jù)以包含正確的名稱(chēng)標(biāo)識(shí)符:

                  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")));
                  

                  這在簽名中包含了預(yù)期的標(biāo)識(shí)符,并且簽名驗(yàn)證成功.

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

                  這篇關(guān)于驗(yàn)證 JWT 簽名時(shí)出現(xiàn) SecurityTokenSignatureKeyNotFoundException的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  What are good algorithms for vehicle license plate detection?(車(chē)牌檢測(cè)有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運(yùn)行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                  Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 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="qwawimqqmiuu" 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>

                          • 主站蜘蛛池模板: 免费一级片 | 欧美日韩视频 | 久久精品电影 | 成人精品在线视频 | 一区二区三区国产好的精 | 久久久五月天 | 国产一区二区三区视频免费观看 | 999久久久久久久久6666 | 国产精品一区二区av | 中文字幕第一页在线 | 亚洲电影一区二区三区 | 国产高清久久 | 国产aaaaav久久久一区二区 | 日本电影韩国电影免费观看 | 国产精品久久久久国产a级 欧美日韩国产免费 | 国产黄色精品 | 在线成人av | 羞羞视频免费在线观看 | www国产成人| 欧美日韩亚洲国产综合 | 中文字幕国产一区 | 99re视频在线 | 国产一区二区 | 狠狠操狠狠操 | 毛片免费看的 | 精品免费国产一区二区三区 | 午夜天堂精品久久久久 | 中文字幕在线观看一区二区 | 性视频网 | 国产成人精品久久二区二区91 | 国产精品久久久久不卡 | 国产成人一区二区三区精 | 超碰欧美 | 成人av在线播放 | 伊人伊人伊人 | 亚洲欧洲精品成人久久奇米网 | 999精品视频 | 国产精品99久久久久久www | 黄色av免费| 91精品国产91久久综合桃花 | 亚洲成人免费观看 |