php-tenant/Contracts/TwoFactorAuthenticationProvider.php
Snider d0ad2737cb refactor: rename namespace from Core\Mod\Tenant to Core\Tenant
Simplifies the namespace hierarchy by removing the intermediate Mod
segment. Updates all 118 files including models, services, controllers,
middleware, tests, and composer.json autoload configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:30:46 +00:00

36 lines
996 B
PHP

<?php
declare(strict_types=1);
namespace Core\Tenant\Contracts;
/**
* Contract for two-factor authentication providers.
*
* Handles TOTP (Time-based One-Time Password) generation and verification
* for user accounts. Typically implemented using libraries like Google Authenticator.
*/
interface TwoFactorAuthenticationProvider
{
/**
* Generate a new secret key for TOTP.
*/
public function generateSecretKey(): string;
/**
* Generate QR code URL for authenticator app setup.
*
* @param string $name Application/account name
* @param string $email User email
* @param string $secret TOTP secret key
*/
public function qrCodeUrl(string $name, string $email, string $secret): string;
/**
* Verify a TOTP code against the secret.
*
* @param string $secret TOTP secret key
* @param string $code User-provided 6-digit code
*/
public function verify(string $secret, string $code): bool;
}