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.

Dotnet Core 2.1 broke WriteToken() on Linux kernels (ObjectDisposedException)

See original GitHub issue

System.IdentityModel.Tokens.Jwt isn’t working anymore on our Linux environment when we try to generate a Jwt.

This problem is specifically in .NET Core 2.1 when calling new JwtSecurityTokenHandler().WriteToken(jwt)

An example of the bug can be found in this repo: https://github.com/AaronFixer/RsaMicrosoftIdentityJwtLinuxBug

Just run dotnet run from within a Linux distro (I did this on Ubuntu 16.04 and 17.10).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AaronFixercommented, Jun 15, 2018

@brentschmaltz As you quite rightly pointed out, this issue isn’t actually a bug as disposed objects shouldn’t be available outside of their context.

On Windows however, the disposed object appears to still be available as the token is generated fine (run the code I originally submitted on Windows, and you’ll see the token is generated).

This isn’t correct behavior though. As it should throw the same error (ObjectDisposedException).

0reactions
brentschmaltzcommented, Jun 14, 2018

@AaronFixer can you explain to me what you mean about ‘still works on Windows OS’?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgraded dotnet core 2.1 - ObjectDisposedException: Safe ...
WriteToken() from the System.IdentityModel.Tokens.Jwt library to generate tokens. We've upgraded to 2.1 and this method is now working correctly ...
Read more >
Fix List for DB2 Version 9.7 for Linux, UNIX and Windows
DB2 9.7 APAR Fix list contains list of APARs shipped for each fix pack in DB2 Version 9.7 for Linux, UNIX and Windows...
Read more >
Install .NET on Linux distributions
This article details how to install .NET on various Linux distributions either manually, via a package manager, or via a container. Manual ...
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