jsonwebtoken_decode 1.0.3 jsonwebtoken_decode: ^1.0.3 copied to clipboard
Package for decoding Json Web Token (JWT), and selecting specific claims.
JSONWEBTOKEN DECODE #
Package for decoding Json Web Token (JWT), and selecting specific claims.
Features #
- Decode jwt;
- Get Header and Payload claims;
- Get OpenID claims;
- Get Keycloak claims;
- Get custom claims;
Usage #
// ...
final String _token ="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";
JWTApp? _app;
Payload? _payload;
Header? _header;
@override
void initState() {
super.initState();
_app = JWTApp(_token);
_payload = _app!.payload;
_header = _app!.header;
}
// ...
Text('${_payload!.claim('name')'),
See more: example;
Created following iana guidelines: https://www.iana.org/assignments/jwt/jwt.xhtml;
Sample token from jwt official website: https://jwt.io/;