简体   繁体   English

将System.IdentityModel.Tokens.Jwt 4.0.2更新为5.4令牌问题

[英]Update System.IdentityModel.Tokens.Jwt 4.0.2 to 5.4 Token Issues

I am trying to update my code from System.IdentityModel.Tokens 4.0.2 to the latest version 5.4 but i got a couple errors that i can not figure it out. 我正在尝试将我的代码从System.IdentityModel.Tokens 4.0.2更新到最新版本5.4,但是我遇到了几个错误,无法弄清。

app.UseActiveDirectoryFederationServicesBearerAuthentication(
        new ActiveDirectoryFederationServicesBearerAuthenticationOptions
        {
            MetadataEndpoint = "MetadataEndpoint",
            TokenValidationParameters = new TokenValidationParameters()
            {
                ValidAudience = "Audience",
                ValidIssuer = "Issuer"
            }
        }

TokenValidationParameters are not valid anymore. TokenValidationParameters不再有效。

app.UseJwtBearerAuthentication(
            new JwtBearerAuthenticationOptions
            {
                AuthenticationMode = AuthenticationMode.Active,
                AllowedAudiences = new[] { audienceId },
                IssuerSecurityTokenProviders = new IIssuerSecurityTokenProvider[]
                {
                    new SymmetricKeyIssuerSecurityTokenProvider(issuer, audienceSecret)
                }
            }); 

IssuerSecurityTokenProviders not available too. IssuerSecurityTokenProviders也不可用。

Has any one encounter the same issue? 有没有人遇到过同样的问题? any pointers. 任何指针。

Could you be running into this issue? 您能遇到这个问题吗?

5.x is not compatible with Katana 3 - it is for .NET Core going forward. 5.x与Katana 3不兼容-面向.NET Core。 You need to stay on 4.x 您需要继续使用4.x

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 System.IdentityModel.Tokens.Jwt 验证在 C# 中生成的令牌 - Verify Token generated in C# with System.IdentityModel.Tokens.Jwt 使用ASP.NET 5中的System.IdentityModel.Tokens.Jwt编码JWT令牌 - Encoding JWT Token Using System.IdentityModel.Tokens.Jwt in ASP.NET 5 无法读取使用 System.IdentityModel.Tokens.Jwt 生成的 JWT 令牌 - Unable to read JWT token generated using System.IdentityModel.Tokens.Jwt 使用System.IdentityModel.Tokens.Jwt在Web API中进行JWT身份验证 - JWT Authentication in Web API using System.IdentityModel.Tokens.Jwt 如何使用 System.IdentityModel.Tokens.Jwt package 提取令牌过期时间 - How to extract the token expiration time with the System.IdentityModel.Tokens.Jwt package 更新System.IdentityModel.Tokens.Jwt导致IdentityServer3客户端发生重大更改 - Update of System.IdentityModel.Tokens.Jwt causing breaking change in IdentityServer3 Client 在System.IdentityModel.Tokens.Jwt中键入加载错误 - Type Load error in System.IdentityModel.Tokens.Jwt System.Identitymodel.Tokens.jwt 没有发行人可能吗? - System.Identitymodel.Tokens.jwt without issuer possible? 使用System.IdentityModel.Tokens.Jwt从5.1迁移到2.0后,JWTAuthentication无法在asp.net core 2.0中运行 - 5.1.4更新 - JWTAuthentication not working in asp.net core 2.0 after migrate from 1.1 to 2.0 with System.IdentityModel.Tokens.Jwt - 5.1.4 update 使用System.IdentityModel.Tokens.Jwt与RS512验证JWT签名 - Validate JWT signature with RS512 using System.IdentityModel.Tokens.Jwt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM