简体   繁体   中英

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

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.

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

依赖

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM