Skip to content

greenygh0st/JWT-Decoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);