jwt_decode_full library

jwt_decode_full is a package that decodes JWTs and returns a JWTData object. The main objective is to provide a simple way to extract the header data as well as the payload data from JWTs.

You can also extract the expiration date, issuedAt date, and isExpired from the payload if they exist. If not these would simply return null.

The usage of this package simple:

final jwtData = jwtDecode(myToken);

print('header: ${jwtData.header}');
print('payload: ${jwtData.payload}');
print('isExpired: ${jwtData.isExpired}');
print('issued date: ${jwtData.issuedAt}');
print('expiration date: ${jwtData.expiration}');

Classes

JWTData
JWTData is a class that contains the header, payload of a JWT. By using the isExpired, issuedAt, and expiration getters, you can easily extract the calculated results for these properties.

Functions

jwtDecode(String token) JWTData
jwtDecode provides a way to decode different types of JWTs and extract their payloads, headers, expiration dates, and issued dates and whether they are expired or not.