JwtConfigFromPasswords constructor

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

Creates a new JwtConfigFromPasswords instance.

Implementation

JwtConfigFromPasswords({
  super.fallbackRefreshTokenHashPeppers,
  super.accessTokenLifetime,
  super.refreshTokenLifetime,
  super.issuer,
  super.refreshTokenFixedSecretLength,
  super.refreshTokenRotatingSecretLength,
  super.refreshTokenRotatingSecretSaltLength,
  super.extraClaimsProvider,
  super.fallbackVerificationAlgorithms,
}) : super(
       refreshTokenHashPepper: Serverpod.instance.getPasswordOrThrow(
         'jwtRefreshTokenHashPepper',
       ),
       algorithm: JwtAlgorithm.hmacSha512(
         SecretKey(
           Serverpod.instance.getPasswordOrThrow('jwtHmacSha512PrivateKey'),
         ),
       ),
     );