Skip to content

Newtonsoft dependency and Blazor Client apps #204

Closed
@dazinator

Description

@dazinator

I'd love to use this library in a Blazor Client application.
Microsoft have recently switched away from being relient on Newtonsoft as a dependency, and instead use System.Text.Json by default (developers can still opt-in to using newtonsoft if they wish). This is a bit more lightweight and works well in Blazor client applications as well as on the server side. Newtonsoft was never designed to be lightweight for browser side use.

However one gap in blazor client side apps is that there is no lightweight mechanism for decoding a JWT into a claims principal. See my issue here: dotnet/aspnetcore#11417

So I found your library. The problem is, it pulls in newtonsoft.json by default (I know you can use a custom serialiser implementation, but the damage has already been done as the newtonsoft dependency is still pulled into the app increasing it's size).

Would you consider splitting jwt into jwt and jwt.newtonsoft packages so the newtonsoft serialiser package was optionally adopted? That way I could use jwt without the newtonsoft dependency, and then implement a serialiser based on System.Text.Json?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions