php-tenant/Contracts/TwoFactorAuthenticationProvider.php
Snider 86dbf4e763 fix: namespace to Core\Mod\Tenant, restructure package
- Changed namespace from Core\Core\Tenant to Core\Mod\Tenant
- Moved src/ contents to root
- Removed Host UK extension files (admin.php, MemberManager, TeamManager)
- Fixed composer.json autoload paths
2026-01-27 00:58:42 +00:00

36 lines
1,000 B
PHP

<?php
declare(strict_types=1);
namespace Core\Mod\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;
}