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

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

        <legend id='GIagu'><style id='GIagu'><dir id='GIagu'><q id='GIagu'></q></dir></style></legend>

          <bdo id='GIagu'></bdo><ul id='GIagu'></ul>
      1. JwtSecurityToken 理解與異常

        JwtSecurityToken understanding and exception(JwtSecurityToken 理解與異常)

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

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

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

                  <tfoot id='EIKnv'></tfoot>
                  本文介紹了JwtSecurityToken 理解與異常的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我對 JwtSecurityTokens 還很陌生,我試圖了解它的不同方面,以及整個 claimsidentityclaimprincipal,但那是另一回事了.

                  我嘗試使用以下代碼在 C# 中生成令牌:

                  private const string SECRET_KEY = "abcdef";私有靜態(tài)只讀 SymmetricSecurityKey SIGNING_KEY = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(SECRET_KEY));公共靜態(tài)字符串 GenerateToken(string someName){var token = new JwtSecurityToken(索賠:新索賠[]{新聲明(ClaimTypes.Name,someName),},notBefore: 新的 DateTimeOffset(DateTime.Now).DateTime,過期:新的 DateTimeOffset(DateTime.Now.AddMinutes(60)).DateTime,簽名證書:新的簽名證書(SIGNING_KEY,SecurityAlgorithms.HmacSha256));返回新的 JwtSecurityTokenHandler().WriteToken(token);}

                  <塊引用>

                  我遵循了 Youtube 上的教程,但我不確定我是否理解JwtSecurityToken 中的不同部分.另外,當(dāng)我執(zhí)行通過控制器的代碼只是為了嘗試返回一個令牌,它返回一個錯誤,說:IDX10603:解密失敗.密鑰嘗試:'[PII 被隱藏]'".

                  感謝任何幫助.

                  解決方案

                  算法 HS256 要求 SecurityKey.KeySize 大于 128 位,而您的密鑰只有 48 位.通過添加至少還有 10 個符號.至于PII 被隱藏"部分,它是作為 GDPR 合規(guī)性工作的一部分,以隱藏日志中的任何堆棧或變量信息.您應(yīng)該啟用其他詳細信息:

                  IdentityModelEventSource.ShowPII = true;

                  I'm fairly new to JwtSecurityTokens, and I try to understand the different aspects of it and furhtermore the whole claimsidentity and claimprincipal, but that's another story.

                  I try to generate a token in C# by using the following code:

                  private const string SECRET_KEY = "abcdef";
                  private static readonly SymmetricSecurityKey SIGNING_KEY = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(SECRET_KEY));
                  
                      public static string GenerateToken(string someName)
                      {
                          var token = new JwtSecurityToken(
                              claims: new Claim[]
                              {
                                  new Claim(ClaimTypes.Name, someName), 
                              },
                              notBefore: new DateTimeOffset(DateTime.Now).DateTime,
                              expires: new DateTimeOffset(DateTime.Now.AddMinutes(60)).DateTime,
                              signingCredentials: new SigningCredentials(SIGNING_KEY, SecurityAlgorithms.HmacSha256)
                          );
                  
                          return new JwtSecurityTokenHandler().WriteToken(token);
                      }
                  

                  I followed a tutorial on Youtube, but I'm not sure I understand the different parts in the JwtSecurityToken. In addition, when I execute the code through a controller just to try to return a token, it returns an error, saying: "IDX10603: Decryption failed. Keys tried: '[PII is hidden]'".

                  Any help is appreciated.

                  解決方案

                  The algorithm HS256 requires the SecurityKey.KeySize to be greater than 128 bits and your key has just 48. Extend it by adding at least 10 more symbols. As for "PII is hidden" part, it was done as a part of GDPR compliance effort to hide any stack or variable info in logs. You should enable additional details with:

                  IdentityModelEventSource.ShowPII = true;
                  

                  這篇關(guān)于JwtSecurityToken 理解與異常的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  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(從函數(shù)調(diào)用按鈕 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?(多個提交按鈕點擊問題?)

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

                          <bdo id='g0s3G'></bdo><ul id='g0s3G'></ul>

                            <tfoot id='g0s3G'></tfoot>

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

                            <legend id='g0s3G'><style id='g0s3G'><dir id='g0s3G'><q id='g0s3G'></q></dir></style></legend>

                              <tbody id='g0s3G'></tbody>
                          1. 主站蜘蛛池模板: 中文字幕一区二区三区精彩视频 | 日韩精品视频一区二区三区 | 波多野结衣精品 | 久久久久高清 | 欧美成年人视频在线观看 | 国产一区二区三区久久久久久久久 | 少妇特黄a一区二区三区88av | 天天舔天天 | 久久国产精品视频 | 亚洲欧美少妇 | 在线永久看片免费的视频 | 亚洲免费一区 | 久久精品av| 嫩草视频入口 | www.蜜桃av| 99热这里都是精品 | 久久成人国产精品 | 日韩精品一区二区三区在线观看 | 一区二区三区四区在线视频 | 玖玖久久 | 在线视频一区二区 | 国产精品久久久99 | 黄色大片在线播放 | 国产免费一区二区三区 | 日韩av在线免费 | 亚洲欧美日本国产 | 亚洲欧美一区二区三区国产精品 | 国产98色在线 | 日韩 | 黄色av观看 | 91 在线| 在线观看国产www | 天天操天天射综合网 | 成人一区在线观看 | 亚洲欧洲成人av每日更新 | 国产日韩一区 | 综合网在线 | 久久久久国产精品一区二区 | 中文字幕在线观看一区二区 | 国产精品五月天 | 亚洲精品免费观看 | 日韩欧美成人一区二区三区 |