<small id='0UdM1'></small><noframes id='0UdM1'>

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

      • <bdo id='0UdM1'></bdo><ul id='0UdM1'></ul>
    1. <tfoot id='0UdM1'></tfoot>

      <legend id='0UdM1'><style id='0UdM1'><dir id='0UdM1'><q id='0UdM1'></q></dir></style></legend>

        .NET JWT 令牌验证的命名空间:系统与 Microsoft

        时间:2023-06-03

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

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

                    <tbody id='bo88e'></tbody>

                1. 本文介绍了.NET JWT 令牌验证的命名空间:系统与 Microsoft的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试使用 JWT 向 ASP.NET Web API 验证 Node 应用程序.

                  I am trying to use JWT to authenticate a Node application to an ASP.NET Web API.

                  在 ASP.NET 中,我使用的是 .NET 4.5.1 和 nuget 包 System.IdentityModel.Tokens.Jwt 5.0.0

                  In ASP.NET, I am using .NET 4.5.1 and nuget package System.IdentityModel.Tokens.Jwt 5.0.0

                  我不明白的是,为什么命名空间在 MicrosoftSystem 之间混合.

                  What I don't understand is, why the namespaces are mixed between Microsoft and System.

                  例如:

                  var tokenReader = new JwtSecurityTokenHandler();
                  
                  tokenReader.ValidateToken(token, 
                                  new TokenValidationParameters()
                              {
                                  ValidateAudience = false
                              },
                                  out validatedToken);    
                  

                  主要的JwtSecurityTokenHandlerSystem.IdentityModel.Tokens.Jwt命名空间,但TokenValidationParameters类及其依赖在Microsoft.IdentityModel.Tokens 命名空间,并可能与 System.IdentityModel.Tokens 命名空间中的类似类发生冲突.

                  The main JwtSecurityTokenHandler is in the System.IdentityModel.Tokens.Jwt namespace, but the TokenValidationParameters class and its dependencies are in the Microsoft.IdentityModel.Tokens namespace, and possibly collide with similar classes in the System.IdentityModel.Tokens namespace.

                  这是设计使然,还是其他地方版本不匹配的可能迹象?

                  Is this by design or is this a possible sign of a version mismatch somewhere else?

                  推荐答案

                  如果你看一下对

                  nuget System.IdentityModel.Tokens.Jwt 4.0.2

                  对比

                  nuget System.IdentityModel.Tokens.Jwt 5.0

                  你会看到 5.0 依赖于

                  you'll see that 5.0 has a dependency on

                  依赖关系

                  .NETFramework 4.5.1

                  .NETFramework 4.5.1

                  Microsoft.IdentityModel.Tokens (>=5.0.0)

                  Microsoft.IdentityModel.Tokens (>=5.0.0)

                  4.0 没有.事实上,以前的版本没有.

                  that 4.0 didn't have. In fact, no previous version did.

                  Microsoft 正在重新构建他们的框架,使其更轻量级.在 ASP.NET 大小的框架中,您将有许多功能冗余.

                  Microsoft is re-architect-ing their frameworks to be more light weight. In a framework the size of ASP.NET, you will have many functional redundancies.

                  为了使 WIF 更轻,同时保持向后兼容,我们决定从 System.IdentityModel.Tokens.Jwt 等库中删除冗余功能,不再依赖于 System.IdentityModel.令牌,而是在 Microsoft.IdentityModel.Tokens 上.不幸的结果之一是两个层都暴露了相同的方法.

                  To make WIF lighter, while remaining backwards compatible, the decision was made to remove the redundant functionality from libraries like System.IdentityModel.Tokens.Jwt no longer depend on System.IdentityModel.Tokens, but instead on Microsoft.IdentityModel.Tokens. One of the unfortunate results is that both layers expose the same methods.

                  这篇关于.NET JWT 令牌验证的命名空间:系统与 Microsoft的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:用于服务应用程序的 Google oAuth 2.0(JWT 令牌请求 下一篇:Swashbuckle .NET Core 2 中 JWT 承载的授权

                  相关文章

                  最新文章

                2. <i id='xxhGk'><tr id='xxhGk'><dt id='xxhGk'><q id='xxhGk'><span id='xxhGk'><b id='xxhGk'><form id='xxhGk'><ins id='xxhGk'></ins><ul id='xxhGk'></ul><sub id='xxhGk'></sub></form><legend id='xxhGk'></legend><bdo id='xxhGk'><pre id='xxhGk'><center id='xxhGk'></center></pre></bdo></b><th id='xxhGk'></th></span></q></dt></tr></i><div id='xxhGk'><tfoot id='xxhGk'></tfoot><dl id='xxhGk'><fieldset id='xxhGk'></fieldset></dl></div>

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

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

                      <tfoot id='xxhGk'></tfoot>
                        <bdo id='xxhGk'></bdo><ul id='xxhGk'></ul>