final class TotpConfiguration (View source)

Holds interoperable TOTP parameters without selecting an issuer, identity, or MFA policy.

The period has a contract minimum of one second and deliberately no upper framework limit, because interoperability and acceptable login cadence are host policy rather than a universal TOTP mechanism rule.

Methods

__construct(TotpAlgorithm $algorithm = TotpAlgorithm::SHA1, int $periodSeconds = 30, int $digits = 6)

Initializes a configuration with the RFC-compatible SHA-1, 30-second, six-digit default.

Details

__construct

__construct(TotpAlgorithm $algorithm = TotpAlgorithm::SHA1, int $periodSeconds = 30, int $digits = 6)

Initializes a configuration with the RFC-compatible SHA-1, 30-second, six-digit default.

A period must be positive; its upper bound remains owned by the consuming application.

Parameters

TotpAlgorithm $algorithm
int $periodSeconds
int $digits

Exceptions

InvalidTotpConfigurationException