Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in the Microsoft.IdentityModel.Tokens.Jwt library #945

Closed
mafurman opened this issue Jun 11, 2018 · 4 comments
Closed

Add in the Microsoft.IdentityModel.Tokens.Jwt library #945

mafurman opened this issue Jun 11, 2018 · 4 comments
Assignees
Labels
P1 More important, prioritize highly
Milestone

Comments

@mafurman
Copy link
Member

The library should meet the following requirements:

• Remove automatic short-to-long claim type mapping that occurs when tokens are created.
• Prepare a framework for future work that will involve asynchronous token validation and creation.
• Improve the speed of JWT token validation and creation.
• Simplify the way in which JWT tokens are stored and dealt with.
• Provide a single extensibility model using delegates. Previous models provided two models: virtual methods and delegates.

@mafurman mafurman added this to the 5.2.3 milestone Jun 11, 2018
@mafurman mafurman self-assigned this Jun 11, 2018
@mafurman mafurman added the P1 More important, prioritize highly label Jun 11, 2018
@brentschmaltz
Copy link
Member

library was added

@EatonZ
Copy link

EatonZ commented Jul 3, 2018

Is it safe to assume that JsonWebTokenHandler is basically the new version of JwtSecurityTokenHandler? I've been using JwtSecurityTokenHandler and I saw the latest version added JsonWebTokenHandler. Is there a reason to use one over the other? Looking over it, it seems the basic difference is encryption support, but I just want some additional clarification here on why this new handler was added.

@EatonZ
Copy link

EatonZ commented Jul 8, 2018

Hi @mafurman @brentschmaltz, any insight into the above?

@brentschmaltz
Copy link
Member

brentschmaltz commented Jul 15, 2018

@EatonZ JwtSecurityTokenHandler was modeled after the existing System.IdentityModel.SecurityTokenHandler. There were some compromises that we had to make, such as using System.Security.ClaimsIdentity as the type to build the JWS or JWE when using SecurityTokenDescriptor. ValidateToken had an out parameter of type SecurityToken, which doesn't for async.
A ClaimsPrincipal was returned, sometimes using claim type mapping to build the claims.
This model new model, is much lighter weight and works with native Json.Net objects.
We plan on layering on top, so that you can get back to the existing types, but we will allow users to control what is returned using injection and delegates.

We saw performance improvements of up to 100% in some scenarios.

WELL1NGTON added a commit to WELL1NGTON/RestWithASP-NET5Udemy that referenced this issue Jan 11, 2021
Observação Importante!
JsonWebTokenHandler é melhor que JwtSecurityTokenHandler
AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet#945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 More important, prioritize highly
Projects
None yet
Development

No branches or pull requests

3 participants