Initial Version

This commit is contained in:
root
2025-12-21 10:09:54 -05:00
commit 4ae6befc7b
422 changed files with 47225 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
namespace KTXF\Security\Authentication;
use KTXF\Security\Authentication\ProviderContext;
use KTXF\Security\Authentication\ProviderResult;
/**
* Abstract base for authentication provider
*/
abstract class AuthenticationProviderAbstract implements AuthenticationProviderInterface
{
abstract public function type(): string;
abstract public function identifier(): string;
abstract public function label(): string;
abstract public function description(): string;
abstract public function method(): string;
abstract public function icon(): string;
public function verify(ProviderContext $context, string $secret): ProviderResult
{
return ProviderResult::failed(
ProviderResult::ERROR_INVALID_PROVIDER,
'Credential authentication not supported by this provider'
);
}
public function beginChallenge(ProviderContext $context): ProviderResult
{
return ProviderResult::failed(
ProviderResult::ERROR_INVALID_PROVIDER,
'Challenge authentication not supported by this provider'
);
}
public function verifyChallenge(ProviderContext $context, string $code): ProviderResult
{
return ProviderResult::failed(
ProviderResult::ERROR_INVALID_PROVIDER,
'Challenge authentication not supported by this provider'
);
}
public function beginRedirect(ProviderContext $context, string $callbackUrl, ?string $returnUrl = null): ProviderResult
{
return ProviderResult::failed(
ProviderResult::ERROR_INVALID_PROVIDER,
'Redirect authentication not supported by this provider'
);
}
public function completeRedirect(ProviderContext $context, array $params): ProviderResult
{
return ProviderResult::failed(
ProviderResult::ERROR_INVALID_PROVIDER,
'Redirect authentication not supported by this provider'
);
}
}