ServerpodCloudEmailIdpConfig class
An EmailIdpConfig that works with Serverpod Cloud without configuration.
In development and test run mode, verification codes are logged to the
console via Session.alert — the same behavior as the default development
setup. In staging and production run mode, emails are sent through the
hosted Serverpod Cloud transactional email service (see
ServerpodCloudEmailClient).
The staging/production setup reads the scloudAuthEmailKey password, which
is provided automatically by Serverpod Cloud. The key is read lazily when an
email is sent (not at startup), so a self-hosted server still boots when it
is unset. Sending is best-effort: a failure (outage, missing key, non-200,
or timeout) is logged and never propagated, so it neither breaks sign-up nor
reveals whether an account exists during password reset.
If you want to send emails through a custom provider instead, use EmailIdpConfigFromPasswords.
This requires that a Serverpod instance has already been initialized, as
it reads the emailSecretHashPepper password from the passwords.yaml file.
- Inheritance
-
- Object
- IdentityProviderBuilder<
EmailIdp> - EmailIdpConfig
- EmailIdpConfigFromPasswords
- ServerpodCloudEmailIdpConfig
Constructors
- ServerpodCloudEmailIdpConfig({required String appDisplayName, ServerpodCloudEmailClient? emailClient, String? runMode})
-
An EmailIdpConfig that works with Serverpod Cloud without configuration.
factory
Properties
- failedLoginRateLimit → RateLimit
-
The maximum number of failed logins for the same email.
finalinherited
-
fallbackSecretHashPeppers
→ List<
String> -
Optional fallback peppers for validating passwords and verification codes created with previous peppers.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxPasswordResetAttempts → RateLimit
-
How many password reset attempts are allowed for the same email.
finalinherited
- onAfterAccountCreated → AfterAccountCreatedFunction?
-
Callback to be invoked after a new email account has been created.
finalinherited
- onPasswordResetCompleted → OnPasswordResetCompletedFunction?
-
Callback to be invoked after a password reset is successfully completed.
finalinherited
- passwordResetVerificationCodeAllowedAttempts → int
-
How many attempts are permitted for a single password reset verification code (during the passwordResetVerificationCodeLifetime window).
finalinherited
- passwordResetVerificationCodeGenerator → String Function()
-
Function returning the password rest verification code.
finalinherited
- passwordResetVerificationCodeLifetime → Duration
-
The time for password reset verification codes to be valid.
finalinherited
- passwordValidationFunction → PasswordValidationFunction
-
Function to check passwords against a policy during registration and password change.
finalinherited
- registrationVerificationCodeAllowedAttempts → int
-
How many attempts are permitted for an email verification code (during the registrationVerificationCodeLifetime window).
finalinherited
- registrationVerificationCodeGenerator → String Function()
-
Function returning the registration verification code.
finalinherited
- registrationVerificationCodeLifetime → Duration
-
The time for the registration email verification code to be valid.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secretHashPepper → String
-
The pepper used for hashing passwords and verification codes.
finalinherited
- secretHashSaltLength → int
-
The length of the random hash in bytes to be used for each password.
finalinherited
- sendPasswordResetVerificationCode → SendPasswordResetVerificationCodeFunction?
-
Callback to be invoked for sending outgoing password reset emails.
finalinherited
- sendRegistrationVerificationCode → SendRegistrationVerificationCodeFunction?
-
Callback to be invoked for sending outgoing registration emails for the email address verification.
finalinherited
- 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.
inherited
-
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