question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JwtSecurityTokenHandler.CreateJwt no longer sets JwtSecurityToken.SigningCredentials

See original GitHub issue

_Moved from https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server/issues/232._


The recent changes introduced by @brentschmaltz in this commit broke CreateJwt, which is no longer able to flow the SigningCredentials taken as a parameter to the JwtSecurityToken it returns due to the (weird) lossy serialization + deserialization process it’s now using:

https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/KDev/src/System.IdentityModel.Tokens.Jwt/JwtSecurityTokenHandler.cs#L371

This is obviously a serious regression since calling WriteToken to serialize the JWT now results in a compact JWT that lacks the signature.

/cc @brentschmaltz @tushargupta51

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brentschmaltzcommented, Apr 7, 2016

@PinpointTownes It was committed today. Should be in tonight’s myget.release.

0reactions
kevinchaletcommented, Apr 11, 2016

Unfortunately, trying to use the azureadwebstacknightly feed - as I had initially suggested - will cause more pain because ASOS needs to be fixed to react to a breaking change in IdentityModel: https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server/issues/232#issuecomment-207046066

Sadly, since the updated package is not on the aspnetcidev feed we use, I can’t push the fix ATM.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - How can I add kid to jwt header using ...
Here's a code snippet I've used: var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.UTF8.
Read more >
JwtSecurityTokenHandler Class (System.IdentityModel. ...
When a JwtSecurityToken is validated, claims with types found in this ISet<T> will not be added to the ClaimsIdentity. The default value is...
Read more >
Creating And Validating JWT Tokens In C# .NET
We are creating the token for 7 days, but you can set this to anything you want (Or have it not expire it...
Read more >
How to Generate a JWT Token using .NET 6
JWTSecurity Token that includes claims, expiration time, and signing credentials; JWT token using the JWT Security Token Handler. Note: Right- ...
Read more >
JWT without SDKs
This guide takes you through JWT authentication without using a Box SDK. JWT does not require end-user interaction and is designed to authenticate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found