I am trying to use JWT to authenticate a Node application to an ASP.NET Web API.
In ASP.NET, I am using .NET 4.5.1 and nuget package System.IdentityModel.Tokens.Jwt
5.0.0
What I don't understand is, why the namespaces are mixed between Microsoft
and System
.
For example:
var tokenReader = new JwtSecurityTokenHandler();
tokenReader.ValidateToken(token,
new TokenValidationParameters()
{
ValidateAudience = false
},
out validatedToken);
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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…