JwtConfig constructor
JwtConfig({
- required JwtAlgorithm algorithm,
- required String refreshTokenHashPepper,
- List<
String> fallbackRefreshTokenHashPeppers = const [], - List<
JwtAlgorithm> fallbackVerificationAlgorithms = const [], - Duration accessTokenLifetime = const Duration(minutes: 10),
- Duration refreshTokenLifetime = const Duration(days: 14),
- String? issuer,
- int refreshTokenFixedSecretLength = 16,
- int refreshTokenRotatingSecretLength = 64,
- int refreshTokenRotatingSecretSaltLength = 16,
- Future<
Map< extraClaimsProvider(String, dynamic> ?>- Session session,
- 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);
}
}