JwtConfig constructor

JwtConfig({
  1. required JwtAlgorithm algorithm,
  2. required String refreshTokenHashPepper,
  3. List<String> fallbackRefreshTokenHashPeppers = const [],
  4. List<JwtAlgorithm> fallbackVerificationAlgorithms = const [],
  5. Duration accessTokenLifetime = const Duration(minutes: 10),
  6. Duration refreshTokenLifetime = const Duration(days: 14),
  7. String? issuer,
  8. int refreshTokenFixedSecretLength = 16,
  9. int refreshTokenRotatingSecretLength = 64,
  10. int refreshTokenRotatingSecretSaltLength = 16,
  11. Future<Map<String, dynamic>?> extraClaimsProvider(
    1. Session session,
    2. JwtContext context
    )?,
})

Create a new user profile configuration.

Implementation

JwtConfig({
  required this.algorithm,
  required this.refreshTokenHashPepper,
  this.fallbackRefreshTokenHashPeppers = const [],
  this.fallbackVerificationAlgorithms = const [],
  this.accessTokenLifetime = const Duration(minutes: 10),
  this.refreshTokenLifetime = const Duration(days: 14),
  this.issuer,
  this.refreshTokenFixedSecretLength = 16,
  this.refreshTokenRotatingSecretLength = 64,
  this.refreshTokenRotatingSecretSaltLength = 16,
  this.extraClaimsProvider,
}) {
  _validateRefreshTokenHashPepper(refreshTokenHashPepper);
  for (final fallbackPepper in fallbackRefreshTokenHashPeppers) {
    _validateRefreshTokenHashPepper(fallbackPepper);
  }
}