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 theisExpired
,issuedAt
, andexpiration
getters, you can easily extract the calculated results for these properties.