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

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

    1. <legend id='l1WiI'><style id='l1WiI'><dir id='l1WiI'><q id='l1WiI'></q></dir></style></legend>

      <tfoot id='l1WiI'></tfoot>
        <bdo id='l1WiI'></bdo><ul id='l1WiI'></ul>
        <i id='l1WiI'><tr id='l1WiI'><dt id='l1WiI'><q id='l1WiI'><span id='l1WiI'><b id='l1WiI'><form id='l1WiI'><ins id='l1WiI'></ins><ul id='l1WiI'></ul><sub id='l1WiI'></sub></form><legend id='l1WiI'></legend><bdo id='l1WiI'><pre id='l1WiI'><center id='l1WiI'></center></pre></bdo></b><th id='l1WiI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='l1WiI'><tfoot id='l1WiI'></tfoot><dl id='l1WiI'><fieldset id='l1WiI'></fieldset></dl></div>
      1. System.IdentityModel.Tokens 和 Microsoft.IdentityModel.Token

        Conflict between System.IdentityModel.Tokens and Microsoft.IdentityModel.Tokens(System.IdentityModel.Tokens 和 Microsoft.IdentityModel.Tokens 之間的沖突)

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

                <tbody id='X99QU'></tbody>

                <tfoot id='X99QU'></tfoot>

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

                <i id='X99QU'><tr id='X99QU'><dt id='X99QU'><q id='X99QU'><span id='X99QU'><b id='X99QU'><form id='X99QU'><ins id='X99QU'></ins><ul id='X99QU'></ul><sub id='X99QU'></sub></form><legend id='X99QU'></legend><bdo id='X99QU'><pre id='X99QU'><center id='X99QU'></center></pre></bdo></b><th id='X99QU'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='X99QU'><tfoot id='X99QU'></tfoot><dl id='X99QU'><fieldset id='X99QU'></fieldset></dl></div>
                1. <legend id='X99QU'><style id='X99QU'><dir id='X99QU'><q id='X99QU'></q></dir></style></legend>
                  本文介紹了System.IdentityModel.Tokens 和 Microsoft.IdentityModel.Tokens 之間的沖突的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在使用 System.IdentityModel.Tokens 時發生沖突:

                  I have a conflict when using System.IdentityModel.Tokens :

                  using System;
                  using System.Configuration;
                  using System.Data;
                  using System.Data.SqlClient;
                  using System.IdentityModel.Tokens;
                  using System.IdentityModel.Tokens.Jwt;
                  using System.Text;
                  
                  public voidGenereToken()
                  {
                      const string sec = "401b09eab3c013d4ca54922bb802bec8fd5318192b0a75f201d8b3727429090fb337591abd3e44453b954555b7a0812e1081c39b740293f765eae731f5a65ed1";
                      var now = DateTime.UtcNow;
                      var securityKey = new InMemorySymmetricSecurityKey(Encoding.Default.GetBytes(sec));
                      var signingCredentials = new SigningCredentials(securityKey,
                              SecurityAlgorithms.RsaSha256Signature, SecurityAlgorithms.Sha256Digest);
                  
                      var header = new JwtHeader(signingCredentials);
                  
                      var payload = new JwtPayload
                      {
                          {"iss", "a5fgde64-e84d-485a-be51-56e293d09a69"},
                          {"scope", "https://example.com/ws"},
                          {"aud", "https://example.com/oauth2/v1"},
                          {"iat", now},
                      };
                  
                      var secToken = new JwtSecurityToken(header, payload);
                  
                      var handler = new JwtSecurityTokenHandler();
                      var tokenString = handler.WriteToken(secToken);
                      Console.writeLine(tokenString)
                  }
                  

                  創建標頭時出現以下錯誤 (var header = new JwtHeader(signingCredentials);):

                  I get following error when I create header (var header = new JwtHeader(signingCredentials);) :

                  參數類型System.IdentityModel.Tokens.SigningCredentials"不是可分配給參數類型'Microsoft.IdentityModel.Tokens.SigningCredentials'

                  Argument type 'System.IdentityModel.Tokens.SigningCredentials' is not assignable to parameter type 'Microsoft.IdentityModel.Tokens.SigningCredentials'

                  我不明白,因為我的所有類型都引用 System.IdentityModel.Tokens.并且在文檔中 JwtHeader Constructor 需要 System.IdentityModel.Tokens.SigningCredentials

                  I don't understand because all my type refers to System.IdentityModel.Tokens. and in documentation JwtHeader Constructor need System.IdentityModel.Tokens.SigningCredentials

                  不知道怎么了……

                  推薦答案

                  System.IdentityModel.Tokens.Jwt 版本 5.0.0.0 依賴于 Microsoft.IdentityModel.Tokens.

                  System.IdentityModel.Tokens.Jwt version 5.0.0.0 depends on Microsoft.IdentityModel.Tokens.

                  您需要在 Microsoft.IdentityModel.Tokens 命名空間中使用 SigningCredentials.

                  You need to use SigningCredentials in the Microsoft.IdentityModel.Tokens namespace.

                  例子:

                  using System;
                  using System.IdentityModel.Tokens;
                  using System.IdentityModel.Tokens.Jwt;
                  using System.Text;
                  
                  public void voidGenereToken() {
                      const string sec = "401b09eab3c013d4ca54922bb802bec8fd5318192b0a75f201d8b3727429090fb337591abd3e44453b954555b7a0812e1081c39b740293f765eae731f5a65ed1";
                      var now = DateTime.UtcNow;
                      var securityKey = new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(Encoding.Default.GetBytes(sec));
                      var signingCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(
                          securityKey,
                          SecurityAlgorithms.HmacSha256Signature);
                  
                      var header = new JwtHeader(signingCredentials);
                  
                      var payload = new JwtPayload
                      {
                              {"iss", "a5fgde64-e84d-485a-be51-56e293d09a69"},
                              {"scope", "https://example.com/ws"},
                              {"aud", "https://example.com/oauth2/v1"},
                              {"iat", now},
                          };
                  
                      var secToken = new JwtSecurityToken(header, payload);
                  
                      var handler = new JwtSecurityTokenHandler();
                      var tokenString = handler.WriteToken(secToken);
                      Console.WriteLine(tokenString);
                  }
                  

                  這篇關于System.IdentityModel.Tokens 和 Microsoft.IdentityModel.Tokens 之間的沖突的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                  <i id='2OyoE'><tr id='2OyoE'><dt id='2OyoE'><q id='2OyoE'><span id='2OyoE'><b id='2OyoE'><form id='2OyoE'><ins id='2OyoE'></ins><ul id='2OyoE'></ul><sub id='2OyoE'></sub></form><legend id='2OyoE'></legend><bdo id='2OyoE'><pre id='2OyoE'><center id='2OyoE'></center></pre></bdo></b><th id='2OyoE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2OyoE'><tfoot id='2OyoE'></tfoot><dl id='2OyoE'><fieldset id='2OyoE'></fieldset></dl></div>
                      • <bdo id='2OyoE'></bdo><ul id='2OyoE'></ul>

                          <tbody id='2OyoE'></tbody>

                        <tfoot id='2OyoE'></tfoot>
                        1. <small id='2OyoE'></small><noframes id='2OyoE'>

                          • <legend id='2OyoE'><style id='2OyoE'><dir id='2OyoE'><q id='2OyoE'></q></dir></style></legend>
                            主站蜘蛛池模板: 天天射天天操天天干 | 欧美a∨ | 毛片网站在线观看 | 日韩在线免费视频 | 欧美三级免费观看 | www.亚洲.com | av片网 | 亚洲小视频在线观看 | a级大毛片 | 国产精品99久久久精品免费观看 | 国产精品成人在线播放 | 亚洲视频免费在线观看 | 国产成人在线观看免费 | 色吊丝2 | 久久久在线视频 | 国产中文一区二区三区 | 亚洲一区二区精品视频 | 久久久久国产精品 | 中文字幕亚洲精品 | 特一级黄色毛片 | 国产高清免费视频 | 国产在线观看一区二区三区 | 999精品视频| 日本高清视频在线播放 | 精品一区二区久久久久久久网站 | 日本aⅴ中文字幕 | 日韩欧美在线观看视频网站 | 亚洲欧洲日韩精品 中文字幕 | 黄色免费观看 | 日韩视频一区二区三区 | 久久99精品久久久久久国产越南 | 日日日色 | 国产三级日本三级 | 欧美视频精品 | 国产精品久久久久久久久免费软件 | 国产成人精品一区二区三区视频 | 国产超碰人人爽人人做人人爱 | 在线观看亚洲精品 | 亚洲欧美一区二区三区国产精品 | 亚洲视频不卡 | 极品的亚洲 |