final class TotpVerifier (View source)

Verifies a fixed-width TOTP code at the framework clock without retaining replay or identity state.

Methods

Uses the framework clock so callers and tests share one explicit time boundary.

verify(TotpSecret $secret, string $code, TotpConfiguration $configuration, VerificationWindow $window = new VerificationWindow())

Verifies the current time-step before alternating nearest past and future steps deterministically.

Details

__construct

__construct(ClockInterface $clock)

Uses the framework clock so callers and tests share one explicit time boundary.

Parameters

ClockInterface $clock

verify

TotpVerification verify(TotpSecret $secret, string $code, TotpConfiguration $configuration, VerificationWindow $window = new VerificationWindow())

Verifies the current time-step before alternating nearest past and future steps deterministically.

Parameters

TotpSecret $secret
string $code
TotpConfiguration $configuration
VerificationWindow $window

Return Value

TotpVerification