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

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

      2. <legend id='4pHJy'><style id='4pHJy'><dir id='4pHJy'><q id='4pHJy'></q></dir></style></legend>
        • <bdo id='4pHJy'></bdo><ul id='4pHJy'></ul>

        忽略 JWT 中的簽名

        Ignoring signature in JWT(忽略 JWT 中的簽名)

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

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

              <tbody id='EHxxm'></tbody>
          • <legend id='EHxxm'><style id='EHxxm'><dir id='EHxxm'><q id='EHxxm'></q></dir></style></legend>
          • <tfoot id='EHxxm'></tfoot>
                  <bdo id='EHxxm'></bdo><ul id='EHxxm'></ul>
                • 本文介紹了忽略 JWT 中的簽名的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

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

                  我有一個(gè)使用 OpenId Connect 的 Web 應(yīng)用程序.我創(chuàng)建了一個(gè)自簽名證書(shū),但它仍未由 CA 簽名.如何忽略簽名驗(yàn)證?

                  I have an web application that is using OpenId Connect. I created a self signed certificate but it is still not signed by a CA. How can I ignore the signature validation?

                  這是我目前所擁有的:

                  SecurityToken validatedToken = null;
                  
                  var tokenHandler = new JwtSecurityTokenHandler {
                      Configuration = new SecurityTokenHandlerConfiguration {
                          CertificateValidator = X509CertificateValidator.None
                      },
                  };
                  
                  TokenValidationParameters validationParams =
                      new TokenValidationParameters()
                      {
                          ValidAudience = ConfigurationManager.AppSettings["Audience"],
                          ValidIssuer = ConfigurationManager.AppSettings["Issuer"],
                          AudienceValidator = AudienceValidator,
                          ValidateAudience = true,
                          ValidateIssuer = true
                      };
                  
                  return tokenHandler.ValidateToken(jwtToken, validationParams, out validatedToken);
                  

                  它會(huì)拋出以下異常:

                  IDX10500:簽名驗(yàn)證失敗.無(wú)法解決SecurityKeyIdentifier: 'SecurityKeyIdentifier (
                  IsReadOnly = False, 計(jì)數(shù) = 1, 子句[0] =System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause
                  ) ', 令牌:'{"typ":"JWT","alg":"RS256","kid":"issuer_rsaKey"}.{"iss":...

                  IDX10500: Signature validation failed. Unable to resolve SecurityKeyIdentifier: 'SecurityKeyIdentifier (
                  IsReadOnly = False, Count = 1, Clause[0] = System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause
                  ) ', token: '{"typ":"JWT","alg":"RS256","kid":"issuer_rsaKey"}.{"iss":...

                  推薦答案

                  不要忽略簽名,這很危險(xiǎn)!

                  即使您使用自簽名證書(shū),您也可以使用公鑰進(jìn)行簽名驗(yàn)證.

                  Even if you use a self-signed certificate, you will be able to use the public key for signature validation.

                  由于您使用的是 OpenId Connect,因此您應(yīng)該能夠通過(guò)前往 /.well-known/jwks 獲取簽名證書(shū)的公鑰.

                  Since you are using OpenId Connect, you should be able to get the public key for your signing certificate by heading over to /.well-known/jwks.

                  然后您可以像這樣設(shè)置驗(yàn)證參數(shù):

                  Then you can setup your validation parameters like this:

                  var certificate = new X509Certificate2(Convert.FromBase64String(yourPublicKeyGoesHere));
                  
                  var validationParameters = new TokenValidationParameters { 
                      IssuerSigningTokens = new[] { new X509SecurityToken(certificate) }  
                  };
                  

                  之后,你可以調(diào)用ValidateToken:

                  SecurityToken token;
                  var claimsPrincipal = handler.ValidateToken(encodedToken, validationParameters, out token);
                  

                  您真的要忽略簽名嗎?

                  記住,如果你這樣做了,你怎么知道有人沒(méi)有篡改令牌內(nèi)的數(shù)據(jù)?您可以輕松解碼 base64 url?? 編碼的有效負(fù)載并更改主題.如果您在應(yīng)用程序中依賴它,您將遇到麻煩(提示:有人訪問(wèn)其他人的數(shù)據(jù))

                  Remember, if you do, how do you know someone didn't tamper with the data inside the token? You could easily decode the base64 url encoded payload and change the subject. And if you rely on that in your application, you'll be in trouble (hint: someone accessing someone else data)

                  你真的,真的想忽略它嗎?

                  您可以使用 ReadToken 并跳過(guò)所有驗(yàn)證:

                  You can use ReadToken and just skip every validation there is:

                  var badJwt = new JwtSecurityTokenHandler()
                                   .ReadToken(encodedMaliciousToken) as JwtSecurityToken;
                  

                  不要這樣做,這是不好的做法.

                  這篇關(guān)于忽略 JWT 中的簽名的文章就介紹到這了,希望我們推薦的答案對(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?(車牌檢測(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)

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

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

                      1. <tfoot id='dGYsA'></tfoot>
                        <legend id='dGYsA'><style id='dGYsA'><dir id='dGYsA'><q id='dGYsA'></q></dir></style></legend>
                          <bdo id='dGYsA'></bdo><ul id='dGYsA'></ul>

                          • 主站蜘蛛池模板: 六月激情婷婷 | 三级网站在线播放 | 美女国产精品 | 日本美女性生活 | 亚洲综合图片区 | 精品国产一二三区 | 国产在线a | 99福利 | 午夜久久久 | 国产一区二区三区免费 | 中文字幕欧美激情 | 日日操天天操 | 福利在线观看 | 国产三级做爰高清在线 | 日狠狠| 午夜天堂av | 日韩一级免费视频 | 一区在线播放 | 黄色片在线 | 伊人久久影院 | 亚洲69视频| 亚洲高清视频在线观看 | 免费av片 | a毛片视频| 国产日韩在线播放 | 精品一区二区国产 | 欧美日韩在线视频观看 | 亚洲一区二区三区在线 | 黄色精品| 懂色av一区二区三区 | 国产精品一区三区 | 一区二区黄色 | 欧美久久一区 | 亚洲小说欧美激情另类 | 国产片一区二区 | 久久精品视频一区二区 | 久久国产亚洲 | 日韩色综合 | 亚洲激情综合网 | 亚洲激情在线播放 | 超碰免费人人 |