EmailIdpConfig class

Configuration options for the email account module.

Inheritance
Implementers

Constructors

EmailIdpConfig({required String secretHashPepper, List<String> fallbackSecretHashPeppers = const [], Duration registrationVerificationCodeLifetime = const Duration(minutes: 15), int registrationVerificationCodeAllowedAttempts = 3, String registrationVerificationCodeGenerator() = defaultVerificationCodeGenerator, Duration passwordResetVerificationCodeLifetime = const Duration(minutes: 15), int passwordResetVerificationCodeAllowedAttempts = 3, String passwordResetVerificationCodeGenerator() = defaultVerificationCodeGenerator, SendRegistrationVerificationCodeFunction? sendRegistrationVerificationCode, SendPasswordResetVerificationCodeFunction? sendPasswordResetVerificationCode, OnPasswordResetCompletedFunction? onPasswordResetCompleted, RateLimit failedLoginRateLimit = const RateLimit(maxAttempts: 5, timeframe: Duration(minutes: 5)), PasswordValidationFunction passwordValidationFunction = defaultRegistrationPasswordValidationFunction, RateLimit maxPasswordResetAttempts = const RateLimit(timeframe: Duration(hours: 1), maxAttempts: 3), int secretHashSaltLength = 16, AfterAccountCreatedFunction? onAfterAccountCreated, String otpLoginVerificationCodeGenerator() = defaultOtpVerificationCodeGenerator, Duration otpLoginVerificationCodeLifetime = const Duration(minutes: 15), int otpLoginVerificationCodeAllowedAttempts = 3, RateLimit maxOtpLoginAttempts = const RateLimit(timeframe: Duration(minutes: 15), maxAttempts: 5), SendOtpLoginVerificationCodeFunction? sendOtpLoginVerificationCode, bool allowPasswordOnOtpRegistration = false})
Create a new email account configuration.
const

Properties

allowPasswordOnOtpRegistration → bool
Whether users creating an account through a passwordless login may set a password for it.
final
failedLoginRateLimit → RateLimit
The maximum number of failed logins for the same email.
final
fallbackSecretHashPeppers → List<String>
Optional fallback peppers for validating passwords and verification codes created with previous peppers.
final
hashCode → int
The hash code for this object.
no setterinherited
maxOtpLoginAttempts → RateLimit
How many one-time passwords can be requested for the same email.
final
maxPasswordResetAttempts → RateLimit
How many password reset attempts are allowed for the same email.
final
onAfterAccountCreated → AfterAccountCreatedFunction?
Callback to be invoked after a new email account has been created.
final
onPasswordResetCompleted → OnPasswordResetCompletedFunction?
Callback to be invoked after a password reset is successfully completed.
final
otpLoginVerificationCodeAllowedAttempts → int
How many attempts are permitted for a single one-time password (during the otpLoginVerificationCodeLifetime window).
final
otpLoginVerificationCodeGenerator → String Function()
Function returning the one-time password for passwordless logins.
final
otpLoginVerificationCodeLifetime → Duration
The time for the one-time password to be valid.
final
passwordResetVerificationCodeAllowedAttempts → int
How many attempts are permitted for a single password reset verification code (during the passwordResetVerificationCodeLifetime window).
final
passwordResetVerificationCodeGenerator → String Function()
Function returning the password rest verification code.
final
passwordResetVerificationCodeLifetime → Duration
The time for password reset verification codes to be valid.
final
passwordValidationFunction → PasswordValidationFunction
Function to check passwords against a policy during registration and password change.
final
registrationVerificationCodeAllowedAttempts → int
How many attempts are permitted for an email verification code (during the registrationVerificationCodeLifetime window).
final
registrationVerificationCodeGenerator → String Function()
Function returning the registration verification code.
final
registrationVerificationCodeLifetime → Duration
The time for the registration email verification code to be valid.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secretHashPepper → String
The pepper used for hashing passwords and verification codes.
final
secretHashSaltLength → int
The length in bytes of the random salt generated for each hashed secret.
final
sendOtpLoginVerificationCode → SendOtpLoginVerificationCodeFunction?
Callback to be invoked for sending outgoing one-time password emails, for passwordless logins exposed by extending EmailOtpIdpBaseEndpoint. ServerpodCloudEmailIdpConfig sets it.
final
sendPasswordResetVerificationCode → SendPasswordResetVerificationCodeFunction?
Callback to be invoked for sending outgoing password reset emails.
final
sendRegistrationVerificationCode → SendRegistrationVerificationCodeFunction?
Callback to be invoked for sending outgoing registration emails for the email address verification.
final
type → Type
The type of the provider that this builder creates. Used to store the provider in the AuthConfig.
no setterinherited

Methods

build({required TokenManager tokenManager, required AuthUsers authUsers, required UserProfiles userProfiles}) → EmailIdp
Builds a new instance of the identity provider.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited