Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 929 Bytes

README.md

File metadata and controls

34 lines (21 loc) · 929 Bytes

JWT-Decoder

A simple easy to use C# JWT Decoder. Sometimes in a client you just need the token contents. This is meant to get you just that and to validate the token (if you really want to).

Installation

Package is avaliable via NuGet. Or you can download and compile it yourself.

Supported .NET Framework versions:

  • .NET Standard 2.0

Usage

string token = "...";

// receive a tupal with all three parts 
var decodedToken = JWTDecoder.DecodeToken(token);

JwtHeader header = decodedToken.Header; // contains Algorithm, Type

string payload = decodedToken.Payload; // JSON Payload String

string verification = decodedToken.Verification; // base64 encoded

You can also:

string token = "...";

// parse the payload to an object
var decodedTokenPayload = JWTDecoder.DecodePayload<MyCustomObject>(token);