TomServerJwtToken constructor

TomServerJwtToken(
  1. Map<String, Object?> publicData, {
  2. Map<String, Object?> encryptedData = const {},
  3. Duration expiresIn = const Duration(hours: 2),
  4. Duration notBefore = const Duration(seconds: 0),
  5. bool noIssueAt = false,
  6. String? audience,
  7. TomJwtConfiguration? signingConfiguration,
})

Creates a new server-side JWT token.

publicData contains claims visible in the token payload. encryptedData contains sensitive claims that will be RSA-encrypted. expiresIn is how long until the token expires (default: 2 hours). notBefore is the delay before the token becomes valid (default: 0). noIssueAt whether to omit the "iat" claim (default: false). audience the aud claim, when the token is meant for one service. signingConfiguration optional custom configuration for signing.

Implementation

TomServerJwtToken(
  this.publicData, {
  this.encryptedData = const {},
  this.expiresIn = const Duration(hours: 2),
  this.notBefore = const Duration(seconds: 0),
  this.noIssueAt = false,
  this.audience,
  TomJwtConfiguration? signingConfiguration,
}) {
  this.signingConfiguration =
      signingConfiguration ?? this.signingConfiguration;
}