SecretChallengeUtil<T> class

Utility class for creating and verifying secret challenges.

This class provides the core challenge mechanism that can be reused across different authentication flows that require secret challenges (e.g. email registration verification, password reset verification, passwordless login).

The challenge flow follows a two-step verification pattern:

  1. Create a challenge with a verification code sent to the user.
  2. Verify the code and create a completion token.
  3. Use the completion token to complete the operation.

Constructors

SecretChallengeUtil({required Argon2HashUtil hashUtil, required SecretChallengeVerificationConfig<T> verificationConfig, required SecretChallengeCompletionConfig<T> completionConfig})
Creates a new SecretChallengeUtil instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

completeChallenge(Session session, {required String completionToken, required Transaction transaction}) Future<T>
Validates a completion token with all protection mechanisms.
createChallenge(Session session, {required String verificationCode, required Transaction transaction}) Future<SecretChallenge>
Creates a new SecretChallenge from a verification code.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
verifyChallenge(Session session, {required UuidValue requestId, required String verificationCode, required Transaction transaction}) Future<String>
Verifies a verification code against a SecretChallenge.

Operators

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