What is the different between System.IdentityModel.Tokens & Microsoft.IdentityModel.Tokens? Which one should I use in an ASP.NET Core application?

Viewed 7244

We can find two separate packages in the NuGet gallery:

Both seem to receive regularly updated and have millions of downloads.

I know that System.IdentityModel.Tokens.Jwt has a dependency on Microsoft.IdentityModel.Tokens, but I don't know which one should I use in my ASP.NET Core 2.0 application.

I'm using Microsoft.IdentityModel.Tokens now and it is good enough to create JWT tokens and validate them.

Do I need to add System.IdentityModel.Tokens.Jwt to my project and change any code?

PS: I am not using Azure services in this project.

1 Answers

As you pointed out System.IdentityModel.Tokens.Jwt has a dependency on Microsoft.IdentityModel.Tokens

Dependency

As suggested in Link you should use the System.IdentityModel.Tokens.Jwt nuget as Microsoft.IdentityModel.Tokens is the older library.

Related