JWT class

Constructors

JWT(dynamic payload, {Audience? audience, String? subject, String? issuer, String? jwtId, Map<String, dynamic>? header})
JSON Web Token

Properties

audience Audience?
Audience claim
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
JWT header
getter/setter pair
issuer String?
Issuer claim
getter/setter pair
jwtId String?
JWT Id claim
getter/setter pair
payload ↔ dynamic
Custom claims
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subject String?
Subject claim
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sign(JWTKey key, {JWTAlgorithm algorithm = JWTAlgorithm.HS256, Duration? expiresIn, Duration? notBefore, bool noIssueAt = false}) String
Sign and generate a new token.
toString() String
A string representation of this object.
inherited
trySign(JWTKey key, {JWTAlgorithm algorithm = JWTAlgorithm.HS256, Duration? expiresIn, Duration? notBefore, bool noIssueAt = false}) String?
Exactly like sign, just return null instead of throwing exceptions.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

decode(String token) JWT
Decode a token without checking its signature
tryDecode(String token) JWT?
Exactly like decode, just return null instead of throwing exceptions.
tryVerify(String token, JWTKey key, {bool checkHeaderType = true, bool checkExpiresIn = true, bool checkNotBefore = true, Duration? issueAt, Audience? audience, String? subject, String? issuer, String? jwtId}) JWT?
Exactly like verify, just return null instead of throwing exceptions.
verify(String token, JWTKey key, {bool checkHeaderType = true, bool checkExpiresIn = true, bool checkNotBefore = true, Duration? issueAt, Audience? audience, String? subject, String? issuer, String? jwtId}) JWT
Verify a token.