Implementation
Map<String, dynamic> get claimsMap {
var nbf = _getEpochSeconds(notBefore);
var exp = _getEpochSeconds(expires);
var map = <String, dynamic>{};
_addClaimIfNotNull(map, 'name', name);
_addClaimIfNotNull(map, 'sub', subject);
_addClaimIfNotNull(map, 'email', email);
_addClaimIfNotNull(map, 'iss', issuer);
_addClaimIfNotNull(map, 'aud', audience);
_addClaimIfNotNull(map, 'nbf', nbf);
_addClaimIfNotNull(map, 'exp', exp);
_addClaimIfNotNull(map, 'adm', isAdministrator);
_addClaimIfNotNull(map, 'scp', permissions);
_addClaimIfNotNullOrEmpty(map, 'tenantId', tenantId);
_addClaimIfNotNullOrEmpty(map, 'tid', tid);
for (var claim in extra.entries) {
_addClaimIfNotNull(map, claim.key, claim.value);
}
return map;
}